Creates a polyline from a list of
vertices.
Signature
VBA : RetVal = object.AddPolyline(VerticesList)
VL : RetVal = (vlaAddPolyline
object VertricesList)
(vlaaddPolyline
mspace tmp)
 Object : ModelSpace Collection,
PaperSpace Collection, Block
The object or objects this method applies to.
 VerticesList : Variant (array of
doubles); inputonly
An array of OCS coordinates used to create the polyline vertices.
Each vertex is represented with three elements, with the first two
being the X and Y coodinates in OCS; the third element is ignored.
At least two points (six elements) are required for constructing a
polyline object. The array size must be a multiple of three.
 RetVal : Polyline object
The newly created Polyline object.
Remarks
To create a polyline containing arcs, first create the straight polyline,
then set the bulge at specific vertices using the SetBulge method.
This method exists for backward compatibility only. Use the new
AddLightweightPolyline method to create polylines with an optimized
format that saves memory and disk space.
Coordinates can be converted to and from the OCS using the
TranslateCoordinates method.
Example :
(defun c:aladdpolyline (/ pt ptlist tmp myobj a)
(setq thisdrawing
(vlagetactivedocument
(vlaxgetacadobject)))
(setq mspace (vlagetmodelspace thisdrawing))
(setq pt (getpoint "\nSpecify start point: "))
;; Start by assembling a list of points
(setq ptlist (cons pt ptlist))
(while (setq pt (getpoint "\nSpecify next point: " pt))
(setq ptlist (cons pt ptlist))
)
;; "dissolve" the points into atoms with append:
(setq ptlist (apply 'append ptlist))
;; If number of coordinates in point list is not
;; a multiple of 3 then a polyline can't be made.
;; If it's a multiple of 3 then put the point
;; list into an array and pass it on to vlaaddPolyline:
(if (= (rem (length ptlist) 3) 0)
(progn
(setq
tmp (vlaxmakesafearray
vlaxvbDouble
(cons 0 ( (length ptlist) 1))
)
)
(vlaxsafearrayfill tmp ptlist)
(setq myobj (vlaaddPolyline mspace tmp))
)
(princ "\nerror: Polyline could not be created")
)
;; Just for the fun of it, convert every other segment
;; to a semicircle. First, get number of vertex points
;; and then set the bulge factor for every second point:
(if myobj
(progn
(setq coords (vlagetcoordinates myobj))
(setq coords (vlaxsafearray>list
(vlaxvariantvalue
(vlagetcoordinates myobj))
)
)
(setq a 0)
(while (< a (/ (length coords) 3))
(if (= (rem a 2) 0)
(vlasetBulge myobj a 1.0)
)
(setq a (1+ a))
)
)
)
)

