Reputation: 261
Assume I have a 3D model imported from a step file. I have
Design design1
to work with a 3D imported model.Drawing drawing
where I create my 2D VectorView topView
Design design2
where I work on my actual designI 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.'
Upvotes: 0
Views: 113
Reputation: 8651
Please try design1.CopyTo(design2)
and you'll get an exact -deep- copy of what you have on design1
control.
Upvotes: 1