As evidenced by over 30 years of development history, trust-worthy Korean CAD, CADian!
FAQ
·
2013.12.11
CADian VBA Sample Code - 10 [ Copy ]
|
---|
Duplicates the given object to the same location. Signature RetVal = object.Copy Object All Drawing Objects RetVal Object The newly created duplicate object. Remarks AttributeReference: You should not attempt to use this method on AttributeReference objects. AttributeReference objects inherit this method because they are one of the drawing objects, however, it is not feasible to perform this operation on an attribute reference. NOTE You cannot execute this method while simultaneously iterating through a collection. An iteration will open the work space for a read-only operation, while this method attempts to perform a read-write operation. Complete any iteration before you call this method. ---------------------------------------------------------------- Dim myDoc As IntelliCAD.Document Dim myLine As IntelliCAD.Line Dim myStartPt As IntelliCAD.Point Dim myEndPt As IntelliCAD.Point Set myDoc = Application.ActiveDocument Set myStartPt = Library.CreatePoint(4, 4) Set myEndPt = Library.CreatePoint(7, 3) Set myLine = myDoc.ModelSpace.AddLine(myStartPt, myEndPt) myLine.Update "" Copy and rotate the line Dim copymyLine As IntelliCAD.Line Set copymyLine = myLine.Copy() copymyLine.Rotate myStartPt, 10 MsgBox "Rotated the copied line 10 radians." ThisDocument.ActiveViewport.ZoomExtents |