Assume I have a 3D model imported from a step file. I have
Design design1to work with a 3D imported model.Drawing drawingwhere I create my 2DVectorView topViewDesign design2where I work on my actual design
I would like to create a Block from this topView to use in Design design2 and if I change the model in design1 and/or create another VectorView on drawing does not impact anything on design2. The current workaround is to save the topView as a 2D CAD then import it back.
My code to read the 3D step file and place it to design1
var rf = new ReadSTEP(@"C:\\Sample3DModel.stp");
rf.DoWork();
rf.AddToScene(design1)
My code to create a vector view viewType.Top
drawing.Sheets.Clear();
//Empty sheet
var sheet1 = new Sheet(linearUnitsType.Millimeters, 100, 100, "Sheet 1");
var topView = new VectorView(80, 80, viewType.Top, sheet1.Scale, "Top");
topView.HiddenSegments = false;
topView.Selectable = false;
sheet1.Entities.Add(topView);
drawing.Sheets.Add(sheet1);
drawing.Rebuild(design1);
drawing.ActiveSheet = sheet1;
drawing.Invalidate();
I tried to collect Entities from topView but error var entities = topView.GetEntities(new BlockKeyedCollection()); error: 'A Block with name Top does not exist.'
Please try
design1.CopyTo(design2)and you'll get an exact -deep- copy of what you have ondesign1control.