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:
Creates a line passing through two points.
Creates a 2D lightweight polyline from a list of vertices.
Creates a multiline.
Creates a 2D or 3D polyline.
.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). For information about converting OCS coordinates, see
This example uses the AddLightweightPolyline method to create a simple two-segment polyline using the 2D coordinates (2,4), (4,2), and (6,4).
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. _