在Petrel中,是否可以使用海洋在输入树中复制粘贴项?我需要一个特定的油井或战略的副本,我如何做到这一点?
例如,如果我想要这个井(MyWell)的副本:
Tubing = e.Data.GetData(typeof(TubingString)) as TubingString;
Borehole myWell=Tubing.Borehole;我的无聊(博霍尔):
WellRoot Welrot = Slb.Ocean.Petrel.DomainObject.Well.WellRoot.Get(PetrelProject.PrimaryProject);
BoreholeCollection Borhol = Welrot.BoreholeCollection;或者拥有DevelopmentStrategy (OldStrategy)的副本:
EclipseFormatSimulator.Arguments args=WellKnownSimulators.ECLIPSE100.GetEclipseFormatSimulatorArguments(theCase);
DevelopmentStrategy oldStrategy=args.Strategies.DevelopmentStrategies.First();转到DevelopmentStrategyCollection (策略性):
SimulationRoot simroot = SimulationRoot.Get(PetrelProject.PrimaryProject);
DevelopmentStrategyCollection strategycol=simroot.DevelopmentStrategyCollection;发布于 2014-07-15 14:11:01
许多在Petrel中具有复制/粘贴功能的域对象实现了一个名为ICopyable的接口。然而,我不认为这是一致的所有领域对象。复制/粘贴域对象的一种更可靠的方法是通过使用ICopyableFactory服务。
Borehole borehole = ...;
ICopyable copyable = borehole as ICopyable;
if (copyable == null)
{
ICopyableFactory factory = CoreSystem.GetService<ICopyableFactory>(borehole);
copyable = factory.GetCopyable(borehole);
}
if (copyable != null)
{
IDataSourceManager sourceMgr = ...;
IDataSourceManager targetMgr = ...;
IProjectInfo sourceProjectInfo = ...;
IProjectInfo targetProjectInfo = ...;
ICoordinateReferenceSystem sourceCrs = ...;
ICoordinateReferenceSystem targetCrs = ...;
ICoordinateOperation coordinateOperation = ...;
CopyContext.Element ignoreElements = ...;
CopyContext.Identify identity = ...;
object targetCollection = ...;
object snapshot = copyable.GetSnapshot();
CopyContext context = new CopyContext(sourceMgr, targetMgr,
sourceProjectInfo, targetProjectInfo, sourceCrs, targetCrs
coordinateOperation, ignoreElements, identity, targetCollection,
snapshot);
Borehole copy = copyable.Copy(context) as Borehole;
}ICopyable.Copy需要很多参数,因为该方法也用于参考项目工具(用于在项目之间复制域对象)。如果要在同一个项目中复制域对象,则所有相关的源/目标属性都将是相同的(即targetMgr = sourceMgr)。
https://stackoverflow.com/questions/24242116
复制相似问题