As evidenced by over 30 years of development history, trust-worthy Korean CAD, CADian!
FAQ
·
2013.12.11
CADian VBA Sample Code - 12 [ Polyline ]
|
---|
Creates a polyline from a list of vertices. Signature RetVal = object.AddPolyline(VerticesList) Object ModelSpace Collection, PaperSpace Collection, Block The objects this method applies to. VerticesList Variant (array of doubles); input-only 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, and then set the bulge at specific vertices using the SetBulge method. This method exists for backward compatibility only. Use the 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. ------------------------------------------------------------ Dim myDoc As IntelliCAD.Document Dim myPline As Polyline Dim myPoints As Points Dim pt As Point Set myDoc = ActiveDocument Set myPoints = Library.CreatePoints Set pt = Library.CreatePoint(1, 1, 0) myPoints.Add myPoints(myPoints.Count).x = pt.x myPoints(myPoints.Count).y = pt.y myPoints(myPoints.Count).z = pt.z Set pt = Library.CreatePoint(3, 3, 0) myPoints.Add myPoints(myPoints.Count).x = pt.x myPoints(myPoints.Count).y = pt.y myPoints(myPoints.Count).z = pt.z Set myPline = ThisDocument.ModelSpace.AddPolyline(myPoints) myPline.Update ThisDocument.ActiveViewport.ZoomExtents |