warlock-993 Posted December 8, 2016 Share Posted December 8, 2016 can anyone please point me on how to draw a ployline between points. I am using this example but the problem is that the polyline is always starts from the origin (0,0) Dim plineObj As AcadLWPolyline Dim Points(0 To 17) As Double 'Define the polyline Coordinates XY, XY, XY ..... Points(0) = 0: Points(1) = 100 Points(2) = 0: Points(3) = 0 Points(4) = 100: Points(5) = 0 Points(6) = 0: Points(7) = 100 Points( = 50: Points(9) = 150 Points(10) = 100: Points(11) = 100 Points(12) = 100: Points(13) = 0 Points(14) = 100: Points(15) = 100 ' Create a lightweight Polyline object in model space Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(Points) plineObj.Closed = True ZoomAll if any one can help me ... i would really appreciate it Quote Link to comment Share on other sites More sharing options...
goran Posted December 8, 2016 Share Posted December 8, 2016 No, it starts with 0,100. Second point is 0,0. Look at: http://visiblevisual.com/jupgrade/index.php/autocad-vb-vba/5-create-polyline And You have defined points 0 to 15, Points(16) and Points(17) are same as Points(0) and Poins(1) => plineObj.Closed = True I'm too lazy to try it myself Quote Link to comment Share on other sites More sharing options...
warlock-993 Posted December 9, 2016 Author Share Posted December 9, 2016 thanks for your help ... I changed the declaration from (Dim Points(0 To 17) As Double) to (Dim Points(0 To 15) As Double) hen changed the coordinates and it worked Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.