The line is the most basic object in AutoCAD. You can create a variety of lines—single lines, and multiple line segments with and without arcs.
In general, you draw lines by specifying coordinate points. The default linetype is CONTINUOUS, an unbroken line, but various linetypes are available that use dots and dashes.
To create a line, use one of the following methods:
Standard lines and multilines are created on the XY plane of the world coordinate system. Polylines and Lightweight Polylines are created in the object coordinate system (OCS).
This example uses the AddLightweightPolyline method to create a simple two-segment polyline using the 2D coordinates (2,4), (4,2), and (6,4).
Sub Ch4_AddLightWeightPolyline() Dim plineObj As AcadLWPolyline Dim points(0 To 5) As Double ' Define the 2D polyline points points(0) = 2: points(1) = 4 points(2) = 4: points(3) = 2 points(4) = 6: points(5) = 4 ' Create a light weight Polyline object in model space Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points) ThisDrawing.Application.ZoomAll End Sub