Hi all,
I have a that has lineStrings in it. I want to convert all the line strings into lineElement(s) corresponding to the constituent lineStringElement segments lengths and
positions. I have done it manually using the break element, "7-2" command. I want to find a way to do this programatically, as there are numerous LineStringElements in my drawing and it would take ages to complete.
I tried dropping the LineStringElement, but it always says " Nothing to drop", so I am not sure how to fix this.
Thanks
int numVerts; DPoint3d stringPoints[MAX_VERTICES]; MSElement tempElement;
if (SUCCESS != mdlLinear_extract (stringPoints, &numVerts, lsElement, modelRef)) return;
for (int i=0; i < numVerts-1; i++) { // skip over DISCONNECTs... if (DISCONNECT == stringPoints[i].x || DISCONNECT == stringPoints[i+1].x) continue;
// use linestring element as template to retain symbology and attributes if (SUCCESS != mdlLine_create (&tempElement, lsElement, &stringPoints[i])) continue; // do something...call mdlElement_add etc. }
// delete original linestring element if desired...
Hi Brian,
I think using vba would be a better way to solve it for a newbie.
Hi theGreg,
- what about Selection Sets and then using the 7-2 command? Not coding but a clever alternative.
- For codung: use the macro recorder, do your operation and see what the macro recorder spits out.
- And more sophiticated: - Build a scanner for line string and then build lines out of it
Regards, Stefan.
"choose all" followed by "drop string" would work as well...
For the Drop Element tool you need to make sure the toggle for Linestrings/Shapes is selected.
-B
Answer Verified By: theGreg
Unknown said:I tried dropping the LineStringElement, but it always says " Nothing to drop"
A Line String Element is, in MicroStation terms, a primitive element, so by default it thinks there's nothing to drop. Brien's response tells you what to do as a MicroStation user.
Unknown said:I want to find a way to do this programatically
If Brien's suggestion isn't an answer that you can use, then tell us more precisely what you need.
Regards, Jon Summers LA Solutions
Thank you all for your responses
I tried what Brien said, and it worked. Thanks a lot