Jump to content

how to copy a subentity of a block?


taner

Recommended Posts

Dear Sirs.

 

I would like to ask a queation, how to copy the subentity of a block without exploading the block?

 

Thanks very much.

Link to comment
Share on other sites

Please try:

 

(defun c:test (/ basept ent ent_data)
   (vl-load-com)
   (setq ent_data (entget (car (setq ent (nentsel)))))
   (setq basept (cdr (assoc 10 (entget (car (last ent))))))
   (vla-TransformBy
(vlax-ename->vla-object
    (entmakex ent_data)
) ;_ vlax-ename->vla-object
(vlax-tmatrix
    (list
	(list 1. 0. 0. (car basept))
	(list 0. 1. 0. (cadr basept))
	(list 0. 0. 1. (caddr basept))
	(list 0. 0. 0. 1.)
    ) ;_ list
) ;_ vlax-tmatrix
   ) ;_ vla-TransformBy
) ;_ defun

Link to comment
Share on other sites

(defun copy-fmblk (/ e el newent new-entlst)

(while (and

(setq e (nentselp "\n选择块内实体: "))

(= (length e) 4)

)

(setq el (entget (car e)))

(setq newent (entmakex el))

(vla-transformby (vlax-ename->vla-object newent) (vlax-tmatrix

(caddr e)

)

)

(setq new-entlst (cons newent new-entlst))

)

new-entlst

)

Link to comment
Share on other sites

i tested taners version, allows multiple selection and ok also for nested blocks, but needs some extra coding for scaled(uniform/non-uniform) blocks.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...