jim78b Posted November 12, 2021 Posted November 12, 2021 i have to modify this lisp because not work 100% please. It must work with all type of blocks even non uniform scaled. i try it but not work with non uniform scaled block. I want even that i do a multiple selection thanks in advance #COPIA BLOCCHI NIDIFICATI SENZA APRIRE BLOCCO (defun c:cx (/ *error* space ss nent br copy) (vl-load-com) (or *acad* (setq *acad* (vlax-get-acad-object))) (or *acdoc* (setq *acdoc* (vla-get-ActiveDocument *acad*))) (defun *error* (msg) (and msg (/=(strcase msg) "FUNCTION CANCELLED") (princ (strcat "\nError: " msg)) ) (vla-EndUndoMark *acdoc*) (princ) ) (vla-StartUndoMark *acdoc*) (setq space (if (= 1 (getvar 'cvport)) (vla-get-PaperSpace *acdoc*) (vla-get-ModelSpace *acdoc*) ) ) (setq ss (ssadd)) (while (and (setq nent (nentselp "\nSelect a nested block: ")) (= 4 (length nent)) (= "AcDbBlockReference" (vla-get-ObjectName (setq br (vlax-ename->vla-object (car (last nent)))))) (apply '= (mapcar 'abs (list (vla-get-XScaleFactor br) (vla-get-YScaleFactor br) (vla-get-ZScaleFactor br)))) ) (setq copy (vla-insertblock space (vlax-3d-point '(0 0 0)) (vla-get-Name br) 1.0 1.0 1.0 0.0)) (vla-TransformBy copy (vlax-tmatrix (caddr nent))) (vla-Highlight copy :vlax-true) (ssadd (vlax-vla-object->ename copy) ss) ) (command "_.move" ss "") (*error* nil) ) Quote Quote
Recommended Posts
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.