Hi all
I am struggling with setting up import text file parameters for a file that contains breaklines. The breaklines are formated in the way that the points belonging to a beakline are separated between lines START and END. Than each line is composed with X Y Z separated by a space. I am not getting any results ie import is successful but no lines created nor the terrain model.
Start 389315.70 639222.42 194.20 389306.68 639310.05 193.89 389301.92 639358.50 193.55 389303.02 639367.38 193.38 389298.73 639408.97 193.21 389291.78 639463.40 193.38 389283.19 639536.03 193.55 389275.41 639590.54 193.05 389268.29 639647.29 192.88 389263.05 639698.88 193.05 389257.53 639748.12 193.55 389254.16 639776.38 194.17 389247.57 639818.38 193.83 389240.31 639875.59 194.68 End
Benedykt
As a workaround, you could import the coordinates into a DGN, and then add the elements to the terrain model as breaklines. The VBA routine below will import your data. NOTES: (1) there is no error checking (2) the SmartLines are created on the current level with current symbology (3) this is just an example and the code is unsupported
Sub CreateSmartLinesFromFile() Const ForReading = 1 ' Sample data from which SmartLine is created 'Start '389315.70 639222.42 194.20 '389306.68 639310.05 193.89 '389240.31 639875.59 194.68 'End 'Add Microsoft Scripting Runtime ( Tools>References ) to use FileSystemObject Dim fso As New FileSystemObject Dim sourceFile As TextStream Dim strLine As String 'Dim lCount As Long '*** NOTE: the text file is hard coded on the next line *** Set sourceFile = fso.OpenTextFile("D:\Test.txt", ForReading) While Not sourceFile.AtEndOfStream strLine = sourceFile.ReadLine Select Case UCase(strLine) Case "START" 'lCount = lCount + 1 'Debug.Print "Count = " & CStr(lCount) CadInputQueue.SendCommand "PLACE SMARTLINE" Case "END" 'Debug.Print "End" CadInputQueue.SendReset CommandState.StartDefaultCommand Case Else Dim tArr() As String Dim point As Point3d tArr = Split(strLine, " ") 'Debug.Print "X=" & tArr(0) & " Y=" & tArr(1) & " Z=" & tArr(2) With point .X = CDbl(tArr(0)) .Y = CDbl(tArr(1)) .Z = CDbl(tArr(2)) End With CadInputQueue.SendDataPoint point, 1 End Select Wend sourceFile.Close End Sub
Adding survey linking codes might be an option. That workflow would depend on the volume of edits in the ascii file your using as a dataset.
Example edits below:
389315.70 639222.42 194.20 start389306.68 639310.05 193.89389301.92 639358.50 193.55389303.02 639367.38 193.38389298.73 639408.97 193.21389291.78 639463.40 193.38389283.19 639536.03 193.55389275.41 639590.54 193.05389268.29 639647.29 192.88389263.05 639698.88 193.05389257.53 639748.12 193.55389254.16 639776.38 194.17389247.57 639818.38 193.83389240.31 639875.59 194.68 end