cart: empty [ Login ]

Copy an area of a model into another model

1 2 3  next > 
Kai
3/25/2019 12:38 PM
Hello, Is it possible to copy one area of a model and paste it into another model? My approach is: First, reading a file like * .dxf - drawing into a model. Then I copy the area whose coordinates I know. Then I create a new model and copy this area into the new model. The source file is attached to this chat. The area to be copied is inside the blue rectangle level "AREA". Can you please send me a code example? It is sufficient copying from source model and inserting into the new model. I can import dxf into a model, generate a new model and create dxf. Thank for help.
Wout
3/25/2019 12:39 PM
You can clone objects, see the documentation on DxfHandledObject.Clone() and follow the example closely. - Wout
Kai
3/25/2019 1:14 PM
Hello, Sorry, but how do I find this part of the documentation? I found only "CopyFrom (DxfHandledObject, CloneContext)". Can you send me the link to the relevant documentation? Thanks for your help.
Wout
3/25/2019 1:25 PM
Kai
3/25/2019 1:49 PM
Hello, ok, but I do not mean that. I already know how to copy entities from one model to another. But how can I tell if the entity is within my desired range? Can I tell if an entity is completely or partially within a certain area? Thank for help.
Wout
3/25/2019 2:09 PM
You can calculate the bounds of top level entities using the BoundsCalculator class. - Wout
Wout
3/25/2019 2:13 PM
Hmm, method WW.Cad.Actions.SelectInteractor.GetEntitiesInRectangle is probably more suitable. - Wout
Kai
3/25/2019 2:55 PM
Hello, is it neccessary to make a foreach loop or not? Or ist there given a list of entities back?
C# Code:
CloneContext cloneContext = new CloneContext(model, model1, ReferenceResolutionType.CloneMissing); foreach (DxfEntity entity in model.Entities) { //Bereich vom Entity ermitteln und prüfen ob es in das aktuelle Model integriert werden darf DxfEntity clonedEntity = (DxfEntity) entity.Clone(cloneContext); model1.Entities.Add(clonedEntity); } cloneContext.ResolveReferences();
Thanks for help
Wout
3/25/2019 3:02 PM
This looks ok. - Wout
Kai
3/25/2019 3:09 PM
Hello, I also can not find the GetEntitiesInRectangle method in the class WW.Cad.Actions Please send me link. Maybe also an example. So that I can understand the parameters. Thank You.
1 2 3  next >