3dwannab Posted March 11 Posted March 11 (edited) I was wondering if there's something like LeeMacs program to steal from another drawing, only redefine the blocks. Currently, this code can import the blocks into the drawing but it doesn't update the definitions. (if (not steal) (load "StealV1-8")) (Steal "O:\\ACAD Blocks, Templates\\2022 Sheet Templates\\CSP_Sheet Templates.dwg" '(("Blocks" ("AN_CSP A1 Landscape 2022" "AN_CSP A2 Landscape 2022") ) ("Dimension Styles" ("ANNO*") ) ) ) Edited March 11 by 3dwannab Quote
3dwannab Posted March 11 Author Posted March 11 @Steven P, the blocks are nested inside a drawing. I have a script to uploaded from dwg but not this. I was hoping if this steal program had this functionality. Quote
BIGAL Posted March 11 Posted March 11 (edited) You may have do as a multi step say steal into a blank dwg wblock out, the insert into correct dwg, Maybe just open other dwg select block and use Ctrl+c, then paste into original dwg. If you need to do this a lot wblock out all the blocks into separate dwg's. Edited March 11 by BIGAL Quote
3dwannab Posted March 12 Author Posted March 12 I think that's the route I will have to go down. Ctrl+C and Ctrl+V doesn't redefine a block unless I'm missing something? Quote
77mc77 Posted May 26 Posted May 26 Take a look here: https://ww3.cad.de/foren/ubb/Forum54/HTML/018068.shtml#000032 and here the code: (defun BrowseForFolder ( text Rootfolder / ret y ) (setq y (vlax-get-or-create-object "shell.application")) (if (setq ret (vlax-invoke y "BrowseForFolder" 0 text 1 Rootfolder)) (setq ret (vlax-get (vlax-get ret "Self") "Path"))) (vlax-release-object y) ret ) (defun get_table (table / tb tb_ls) (setq tb (tblnext table t) tb_ls nil ) (while tb (cond ((= (strcase table) "STYLE") (if (= (boole 1 (cdr (assoc 70 tb)) 1) 0);bit 1 bedeutet Symboleintrag, keine Schrift! (setq tb_ls (append tb_ls (list (cdr (assoc 2 tb))))) ) ) ((= (strcase table) "BLOCK") (if (/= (substr (cdr (assoc 2 tb)) 1 1) "*") (setq tb_ls (append tb_ls (list (cdr (assoc 2 tb))))) ) ) (t (setq tb_ls (append tb_ls (list (cdr (assoc 2 tb))))) ) ) (setq tb (tblnext table)) ) (setq tb_ls (vl-sort tb_ls '<)) ) (defun c:all-block-upd ( / bl_liste ant n bl_ex) (setvar "cmdecho" 0) (command "_undo" "_be") (setq bl_liste (get_table "block")) (if bl_pfad (progn (initget "Ja Nein") (setq ant (getkword (strcat "Pfad " bl_pfad " verwenden? <Ja>/Nein:"))) (if (= ant "Nein") (setq bl-pfad (BrowseForFolder "Blockpfad wählen:" ""))) ) (setq bl_pfad (BrowseForFolder "Blockpfad wählen:" "")) ) (foreach n bl_liste (progn (setq bl_ex (strcat bl_pfad "\\" n ".dwg")) (if (findfile bl_ex) (command "_insert" (strcat n "=" bl_ex) nil)) ) ) (command "_undo" "_end") (setvar "cmdecho" 1) (prin1) ) (defun c:block-upd ( / bl_liste ant n bl_ex) (setvar "cmdecho" 0) (command "_undo" "_be") (setq bl_liste (get_table "block")) (if bl_pfad (progn (initget "Ja Nein") (setq ant (getkword (strcat "Pfad " bl_pfad " verwenden? <Ja>/Nein:"))) (if (= ant "Nein") (setq bl-pfad (BrowseForFolder "Blockpfad wählen:" ""))) ) (setq bl_pfad (BrowseForFolder "Blockpfad wählen:" "")) ) (foreach n bl_liste (progn (setq bl_ex (strcat bl_pfad "\\" n ".dwg")) (if (findfile bl_ex) (progn (initget "Ja Nein") (setq ant (getkword (strcat "Block " n " aktualisieren? <Ja>/Nein:"))) (if (/= ant "Nein") (command "_insert" (strcat n "=" bl_ex) nil)) ) ) ) ) (command "_undo" "_end") (setvar "cmdecho" 1) (prin1) ) (prompt "Funktionen ALL-BLOCK-UPD und BLOCK-UPD geladen. (c) H. Jesse 2006") Quote
3dwannab Posted May 26 Author Posted May 26 (edited) 1 hour ago, 77mc77 said: Take a look here: https://ww3.cad.de/foren/ubb/Forum54/HTML/018068.shtml#000032 Thanks but that only inserts drawings from a folder and updates the definition. I was looking to update blocks from one drawing containing the block definitions. Edited May 26 by 3dwannab Quote
77mc77 Posted May 26 Posted May 26 16 minutes ago, 3dwannab said: Thanks but that only inserts drawings from a folder and updates the definition. I was looking to update blocks from one drawing containing the block definitions. I searched everywhere and found nothing so I settled for this at the time: I export the blocks as separate dwg's (I had more than 6850 blocks so more than 6850 dwgs...) and then use the code above. I don't think you will find anything else because ADCenter already does what you ask - but you have to do it manually for each block. Maybe that's why nobody has developed code for what you're asking for... I keep following the thread hoping that someone will develop this, i would need it too. Quote
77mc77 Posted May 26 Posted May 26 (edited) as an alternative you can use this: for me it did not work because the system administrator did not allow connection to a Slovak server... https://sites.google.com/site/avcplugins/bupdate https://apps.autodesk.com/ACD/en/Detail/Index?id=8761814488752080516&appLang=en&os=Win32_64 Edited May 26 by 77mc77 add a link to autodesk Quote
3dwannab Posted May 26 Author Posted May 26 It hasn't been updated to 2025 unfortunately for me to test. I was hoping Lee Macs tool could do this because there's no point in reinventing the wheel. If I had the time I could get this done but I've more important lisps that need fixing atm but I'll get to this sometime Quote
77mc77 Posted May 26 Posted May 26 it work with autocad2025, now tested. you can download it from website (current version 03 May 2024) or from here AVC_BUpdate_2024_05_03.7z and copy the bundle folder into the autocad plugin folder. this does exactly what you were asking above, and it's free. As I said to verify the (free) licence it connects to a Slovak server and my company did not allow the connection otherwise it is perfect 1 Quote
3dwannab Posted May 26 Author Posted May 26 Cheers @77mc77, I'll give it a go tomorrow at work. Someone in the comments for that plugin said it doesn't update attributes, but an attsync all command might work for that. 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.