2,462
社区成员
发帖
与我相关
我的任务
分享
Sub QSGS()
Open "D:\Matlab\R2012b\work\QSGS\porous.txt" For Input As #1
Input #1, Sumpoints:
'Inout #1 means read single char
ReDim points(0 To Sumline * 3 - 1) As Double
'line here means row
Dim plineObj As AcadPolyline
npoints = 0
For i = 1 To Sumpoints 'Loop through all points
Input #1, x, y 'get coordinate of x,y
points(npoints) = x 'x coordinate of point i
points(npoints + 1) = y 'y coordinate of point i
points(npoints + 2) = 0 'z coordinate of point i
npoints = npoints + 3
Next i
Set plineObj = ThisDrawing.ModelSpace.AddPolyline(points)
ZoomAll
Close
End Sub
Sub QSGS()
Open "D:\Matlab\R2012b\work\QSGS\porous.txt" For Input As #1
Input #1, Sumpoints:
'Inout #1 means read single char
if Sumline<=0 then msgbox "位置一,Sumline<=0!" '
ReDim points(0 To Sumline* 3 - 1) As Double
'line here means row
Dim plineObj As AcadPolyline
npoints = 0
For i = 1 To Sumpoints 'Loop through all points
Input #1, x, y 'get coordinate of x,y
if npoints+2>ubound(points) then msgbox "位置二,i的取值过大,检查一下 1~Sumpoints是不是正确!" & vbcrlf & "Sumpoints=" & cstr(Sumpoints) & " , Sumline="& cstr(Sumline) &" 这两个数据的关系应该不对。"
points(npoints) = x 'x coordinate of point i
points(npoints + 1) = y 'y coordinate of point i
points(npoints + 2) = 0 'z coordinate of point i
npoints = npoints + 3
Next i
Set plineObj = ThisDrawing.ModelSpace.AddPolyline(points)
ZoomAll
Close
End Sub
Sub QSGS()
Open "D:\Matlab\R2012b\work\QSGS\porous.txt" For Input As #1
Input #1, Sumpoints:
'Inout #1 means read single char
if Sumline<=0 then msgbox "位置一,Sumline<=0!" '
ReDim points(0 To Sumline* 3 - 1) As Double
'line here means row
Dim plineObj As AcadPolyline
npoints = 0
For i = 1 To Sumpoints 'Loop through all points
Input #1, x, y 'get coordinate of x,y
if npoints+2>ubound(points) then msgbox “位置二,i的取值过大,检查一下 1~Sumpoints是不是正确!” & vbcrlf & "Sumpoints=" & cstr(Sumpoints) & " , Sumline="& cstr(Sumline) &" 这两个数据的关系应该不对。"
points(npoints) = x 'x coordinate of point i
points(npoints + 1) = y 'y coordinate of point i
points(npoints + 2) = 0 'z coordinate of point i
npoints = npoints + 3
Next i
Set plineObj = ThisDrawing.ModelSpace.AddPolyline(points)
ZoomAll
Close
End Sub