"Copy" Lisp

"Copy" Lisp

sambaldan
Contributor Contributor
3,114 Views
2 Replies
Message 1 of 3

"Copy" Lisp

sambaldan
Contributor
Contributor

I'm currently using variations of 

 

(defun c:CY (/ ss bp)
(if (and (setq ss (ssget "_:L"))
(setq bp (getpoint "\nSpecify base point: "))
)
(command "_.copy" ss "" "_non" bp ".XZ" "_non" bp)
)
(princ)
)

for copying in .XZ, .YZ and .Z Axis only without having to type the whole ".XY" etc. and it works great. However, after one copy it finishes the command. I was wondering if there was a way to keep it copying a single item, in the same axis from the same base point continuously until cancelled - as the normal 'copy' command does.

 

Any help would be really appreciated.

 

Thanks

 

SB

0 Likes
Accepted solutions (1)
3,115 Views
2 Replies
Replies (2)
Message 2 of 3

ВeekeeCZ
Consultant
Consultant
Accepted solution

Try this...

 

(defun c:CY (/ ss bp)
  (if (and (setq ss (ssget "_:L"))
           (setq bp (getpoint "\nSpecify base point: "))
           )
    (progn
      (command "_.copy" ss "" "_m" "_non" bp)
      (while (< 0 (getvar 'CMDACTIVE))
        (command ".XZ" "_non" bp PAUSE))))
  (princ)
  )
0 Likes
Message 3 of 3

sambaldan
Contributor
Contributor

Works perfectly.

 

Thank you!

0 Likes