Copy Method

Back to Methods Reference

Duplicates the given object to the same location.

Signature

VLA : RetVal = object.Copy

VL : RetVal = (vla-copy object)

(setq newobj (vla-copy object))

  • 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.

Example :


(defun c:al-copy ()

(vl-load-com)

;get a reference to the Utilities Object :
(setq util (vla-get-utility 
                   (vla-get-activedocument 
                        (vlax-get-acad-object))))

;select the object                        
(vla-getentity util 'theobj 'ip "\nSelect Object: ")

;get the base point
(setq BP (vla-getpoint util nil
         "\nSpecify base point or displacement: "))

;get the displacement
(setq PT2 (vla-getpoint util BP
          "\nSpecify second point of displacement: "))

;copy the object
(setq newobj (vla-copy theobj))

;move the object
(vla-move newobj BP PT2)

(princ)

);defun

(princ)
 
The AutoLisp/Visual Lisp/VBA Resource Website
Google
Search the WWW Search AfraLisp

Copyright 1999-Perpetuity by AfraLisp

All rights reserved.
Information in this document is subject to change without notice.
Site created and maintained by Kenny Ramage

The AutoLisp/Visual Lisp/VBA Resource Website