I use microstation 08.11.09.578, DGN 2D V7 Upgrade V8
I use C# language
I want to break the LineString association into separate LineStrings as shown below
ElementScanCriteria _MSesc = new ElementScanCriteriaClass(); _MSesc.ExcludeAllTypes(); _MSesc.IncludeType(MsdElementType.LineString); ElementEnumerator oEnumeration = app.ActiveModelReference.Scan(_MSesc); while (oEnumeration.MoveNext()) { oEnumeration.Current.AsLineElement().AsDroppableElement().Drop(); }
I tried but it gives error "Specified cast is not valid"
ba ranh said:I use microstation 08.11.09.578, DGN 2D V7 Upgrade V8
What do you mean by 'DGN 2D V7 Upgrade V8'?
MicroStation's native file format is a DGN file. A file contains DGN models. A model can be 2D or 3D. A DGN file is neither 2D nor 3D.
A previous version of MicroStation used a different file format that is referred to as V7. See the History of MicroStation.
Upgrade V8 is meaningless.
ba ranh said:I use C# language
When you write C# code for MicroStation V8i then you are calling the VBA COM interface. Prefer to develop your prototype using just VBA.
That way you...
ba ranh said:I want to break the LineString association into separate LineStrings
A VBA LineElement implements the VertexList interface. Get that list and create a new LineElement for each pair of vertices in that list.
LineElement
VertexList
Regards, Jon Summers LA Solutions
Jon Summers said:A VBA LineElement implements the VertexList interface. Get that list and create a new LineElement for each pair of vertices in that list.
Good idea, thanks
ba ranh said:Good idea
Here's some sample code.