rcb007 Posted February 17, 2022 Posted February 17, 2022 I know I can take individual dwgs and redefine them into the target dwg by either design center, blocks palette, or lisp routine. Is there a method to take all blocks placed inside a UpdateMaster.dwg (Which has all the most update Blocks), then either redefine / update into the working dwg? Thank you for any help. Quote
mhupp Posted February 18, 2022 Posted February 18, 2022 (edited) http://www.lee-mac.com/steal.html none tech way. save a copy of your updatemaster.dwg in the same folder as the drawing you want updated. delete everything out of updatedmaster but leave the block definitions. then go into your old drawing and cut all and paste it into the updatemaster.dwg. as long as the blocks have the same name & base point you should be good. then use the steal command to move over everything else. Edited February 18, 2022 by mhupp 2 Quote
ronjonp Posted February 18, 2022 Posted February 18, 2022 (edited) This is what I use ... it will require individual drawings per block ( code included ) placed somewhere in your search paths: ;; Redefine blocks with drawings found in search paths (defun c:foo (/ file out) (setq out nil) (vlax-for x (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) (or (wcmatch (vla-get-name x) "*|*,`**") (setq out (cons (vla-get-name x) out))) ) (setvar 'cmdecho 0) (foreach x out (if (setq file (findfile (strcat x ".dwg"))) (progn (command ".-INSERT" (strcat x "=" file) nil) (and (ssget "_x" (list '(0 . "insert") (cons 2 x) '(66 . 1))) (command "._attsync" "name" x) ) ) ) ) (setvar 'cmdecho 1) (princ) ) ;; Export all blocks in a drawing to a subfolder '_ExportedBlocks' (defun c:exportblocks (/ x dir) (vl-mkdir (setq dir (strcat (getvar 'dwgprefix) "_ExportedBlocks\\"))) (setvar 'filedia 0) (vlax-for x (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) (or (wcmatch (vla-get-name x) "*|*,`**") (command "._-wblock" (strcat dir (vla-get-name x)) (vla-get-name x)) ) ) (setvar 'filedia 1) (startapp "explorer" (strcat "/e," dir)) ) Edited February 18, 2022 by ronjonp Quote
rcb007 Posted February 18, 2022 Author Posted February 18, 2022 Thank you guys very much for your direction. Sounds like the only way to get this to work is by doing it individually. If I have over 30 blocks that need to be redefined, then I will make it work. Thanks again! Quote
BIGAL Posted February 19, 2022 Posted February 19, 2022 You can run lee-mac Steal from a program sense you can make a little lisp and steal multiple blocks in 1 go. So if you know the block names then its quick, I have done it. Just need to look again at the command sequence. (if(not steal)(load "StealV1-6")) (Steal "C:\\My Folder\\MyDrawing.dwg" '(("Blocks" "BLK1" "BLK2")) ) ; add more names 1 Quote
rcb007 Posted February 21, 2022 Author Posted February 21, 2022 Nice.... Thank you for sharing. Saves alot of time! 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.