jim78b Posted January 22, 2022 Posted January 22, 2022 (edited) HELLO in this LISP i want the multiple selection WITH RECTANGLE WINDOW and not the single selection is possible? #NESTEND BLOCK COPY WITHOUT OPEN THEM (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) ) Edited January 22, 2022 by jim78b Quote
mhupp Posted January 24, 2022 Posted January 24, 2022 I don't think that is possible. lets say you select multiple blocks with a window how then do you tell AutoCAD what nested blocks you want to copy? I guess you could retool the lisp to allow multiple selections at once. Looks like it already does this. 1 Quote
Linh Posted January 24, 2022 Posted January 24, 2022 If the blocks are not too heavy or not xrefs, I would simply explode them, then make a rectangular selection, put it to the clipboard, then undo the explode command, then pasteclip. Sound very noisy routine but I think it will work, If the blocks are not too heavy or not xrefs, anyway. The given lisp doesn't run copy command. It gets the block name, insertion point, scale, then insert a new one to the current space, with transformed parameters. That is good, the clipboard can be dropped off. If there is Xref, then a block name from xref database insert to current drawing database will be very tricky thing to do. 1 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.