TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Lupo76 on May 09, 2012, 07:53:51 AM

Title: redefining COPY command
Post by: Lupo76 on May 09, 2012, 07:53:51 AM
Hello everyone,
I wrote the following function:

Code: [Select]
(defun undefine-command (cname)
   (if (getcname cname)
     (progn
        (setvar "cmdecho" 0)
        (command "._UNDEFINE" cname)
     )
   )
)


(undefine-command "_copy")

(defun copynew ()
  (alert "This is a test")
  (command "_.copy")
)


(defun c:copia ( )
  (copynew)
)

(defun c:copy ( )
   (copynew)
)

(defun c:_copy ( )
   (copynew)
)

This function works quite well but does not behave exactly like the COPY command in AutoCAD.
In practice, missing the request:
Specify base point or [Displacement / mode] <Spostamento>:

I also tried

Code: [Select]
(command "_.copy" obj"" "_o" "_m")
and other attempts but I can never simulate the exact behavior of the original COPY command.  :cry:
Do you have any idea?

Thanks in advance
Title: Re: redefining COPY command
Post by: CAB on May 09, 2012, 09:16:19 AM
What do you get with this?
(command "_.copy" obj "" pause)