Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

How to ncopy multiple at same place or pause the ncopy command?

darkfprh
Advocate
Advocate

How to ncopy multiple at same place or pause the ncopy command?

darkfprh
Advocate
Advocate

Hi I want to copy some entities from xref and paste same place.

 

(command "ncopy" pause pause "0,0" "0,0")

 

So I tired to pause the command until selection in over.

But select multiple entities, it doesn't work... Please help me

0 Likes
Reply
Accepted solutions (1)
654 Views
4 Replies
Replies (4)

ВeekeeCZ
Consultant
Consultant
Accepted solution

Not so easy to do. Possibly like this

 

(while (setq e (cadr (nentsel))) (command "ncopy" e "" "" ""))

 

But is it really necessary? I mean, how difficult is it to hit enter a couple of times.

 

Anyway, just a few threads lower @pbejse posted a nice example of code how this could be done without the need to fight with ncopy. HERE 

 

(vl-load-com)
(defun c:demo (/ obj tmp)
  (while (setq obj	(nentselp "\nSelect object to copy "
		) ;_ end of nentselp
      )
    (progn
      (setq tmp (entmakex (entget (car obj))))
      (vla-transformby
	(vlax-ename->vla-object tmp)
	(vlax-tmatrix (caddr obj))
      )
      (Vla-put-layer (vlax-ename->vla-object (entlast)) (getvar 'clayer))
    )
  )
)

 

darkfprh
Advocate
Advocate

Thank you so much! It works well 🙂

0 Likes

cadomatic
Enthusiast
Enthusiast
very nice!
is there a way to select all objects in the selected object layer and transform them in one click?
0 Likes

ancrayzy
Advocate
Advocate

Thank you so much.

0 Likes