Hi All,
has anyone got a macro that lists all linestring points?
I am looking for a tool that would work like this:
1. I select some linestrings in MicroStation
2. I run a macro while linestrings are selected
3. The macro produces .txt file:
string 1
234545.324 54645.232 12.324
223545.346 56567.234 13.545
235445.346 56887.234 15.573
string 2
268845.324 54445.232 13.324
229845.346 56337.234 14.545
235225.346 56227.234 17.573
Can anyone help with it? Macro or any tip how to do it will be greatly apreciated. Thank.
You don't need a Macro MS has a builtin tool, search the help for "EXPORT ELEMENT"
Regards
Frank
since 1985: GIS, CAD, Engineering (Civil) Senior Consultant : [Autodesk Civil 3D , Esri ArcGIS, VertiGIS: in previous days : Bentley MS V4 - V8i, GeoGraphics, Bentley Map V8i, InRoads, HHK Geograf, IBr DAVID] : Dev: [C, C++, .NET, Java, SQL, FORTRAN, UML][direct quote by: http://en.wikipedia.org/wiki/Helmut_Schmidt]: "Wer Kritik übel nimmt, hat etwas zu verbergen"Wer Grammatik- und/oder Rechtschreibfehler findet, der darf sie behalten :-)
Hi,
I have checked that - it doesn't give separation between separate strings, just a big list of points. I can't recover separate strings from a report like that.
========
https://itunes.apple.com/us/app/rail-library/id784641429?ls=1&mt=8
code snippet:
Sub Start()Open "C:\\path_to_your_file\\output_file.txt" For Output As #1Dim esc As ElementScanCriteriaSet esc = New ElementScanCriteriaesc.ExcludeAllTypesesc.IncludeType msdElementTypeLineString Dim ee As ElementEnumeratorSet ee = ActiveModelReference.Scan(esc)Dim el As LineElementDim stringNum As LongstringNum = 1Do While ee.MoveNext Print #1, "String " + CStr(stringNum) Dim vertices As Long vertices = ee.Current.AsLineElement.VerticesCount Dim points() As Point3d points = ee.Current.AsLineElement.GetVertices Dim index As Long For index = 0 To vertices - 1 Print #1, CStr(points(index).X) + " " + CStr(points(index).Y) + " " + CStr(points(index).Z) Next stringNum = stringNum + 1LoopClose #1End Sub
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Sure, it does what you want, see:
Use Comma as a speparator!
0.637,2.4881.155,2.8681.450,2.5791.701,2.7562.022,2.5952.412,2.7072.433,2.635
I think the problem is not in the separator between coordinates, but that there are no separators between exported elements - the result is just a plain list of coordinates, so there is no information what coordinates belong to what element.