[求助]请高手过目,看下鄙人的代码为什么不能实现画多段线的功能
Private Sub CommandButton1_Click()<BR>Dim user1 As AcadPolyline<BR>Dim userp As AcadPoint<BR>On Error Resume Next<BR> CommonDialog1.ShowOpen<BR> Open CommonDialog1.FileName For Input As #1<BR> Do While Not EOF(1)<BR> Line Input #1, inputdata<BR> a = inputdata<BR> ' a = Split(inputdata, ",")<BR> Set userp = ThisDrawing.ModelSpace.AddPoint(a)<BR> Set user1 = ThisDrawing.ModelSpace.AddPolyline(a)<BR> Loop<BR> Close #1<BR> Me.Hide<BR> ThisDrawing.Application.ZoomExtents<BR>end sub<BR>请问为什么不能实现将文本文件里的坐标通过Polyline画到当前文档中去呢!<BR>请高手一定指教,不胜感激!<BR>以下是我文本文件里的数据!<BR>611366,3537816<BR>611344,3537965<BR>611031,3537822<BR>611084,3537930<BR>611124,3538024<BR>611047,3537989<BR>611019,3537909 <P>1,若多段线是二维的建议使用AddLightWeightPolyline</P><P>2,使用AddLightWeightPolyline的输入参数是数组,在你的例子里应先</P>
<P>把所有点坐标读入,放到一个一维数组里(x1 y1 x2 y2 .....)</P>
页:
[1]