error "MicroStationDGN._ModelReference.AddElement(MicroStationDGN._Element)"
i don't understand this error, please help me
MicroStationDGN.Application micro = new MicroStationDGN.Application();
designFile = micro.ActiveDesignFile; Point3d start_point = new Point3d(); Point3d end_point = new Point3d(); start_point.X = 59.0; start_point.Y = 200.0; end_point.X = 259.0; end_point.Y = 200.0; designFile.Models[2].Activate(); micro.ActiveModelReference.Activate();
MicroStationDGN.LineElement testLine = micro.CreateLineElement2(null, ref start_point, ref end_point);
micro.ActiveModelReference.AddElement(testLine); testLine.Redraw();
1. Is MicroStation running?
2. Are you in a design file?
3. Remove the Activate() calls.
HTH,
mark anderson [Bentley]
Visit me at https://communities.bentley.com/communities/other_communities/bentley_innovation/default.aspx
that's so necessary
...
micro.ActiveModelReference.Activate();
testLine = micro.CreateLineElement2(null, ref start_point, ref end_point);
micro.ActiveModelReference.AddElement((MicroStationDGN._Element)testLine);
thanks all