jim78b Posted November 18, 2021 Posted November 18, 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 #NESTED BLOCKS COPY WITHOUT OPEN IT (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
Tharwat Posted November 18, 2021 Posted November 18, 2021 Comment or delete this line. (apply '= (mapcar 'abs (list (vla-get-XScaleFactor br) (vla-get-YScaleFactor br) (vla-get-ZScaleFactor br)))) 1 Quote
Tharwat Posted November 18, 2021 Posted November 18, 2021 I did not say add but I said comment or delete from the routine. Quote
jim78b Posted November 18, 2021 Author Posted November 18, 2021 Ok tomorrow i will try..thanks very much. Quote
Lee Mac Posted November 18, 2021 Posted November 18, 2021 vla-transformby cannot apply a non-uniform transformation. 1 Quote
Jonathan Handojo Posted November 19, 2021 Posted November 19, 2021 9 hours ago, Tharwat said: Comment or delete this line. (apply '= (mapcar 'abs (list (vla-get-XScaleFactor br) (vla-get-YScaleFactor br) (vla-get-ZScaleFactor br)))) I was about to say what Lee said... he beat me to it... But it's an interesting challenge, I'll think about it. 1 Quote
jim78b Posted November 19, 2021 Author Posted November 19, 2021 Ok thanks i don't thought it was so hard .best regards 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.