gilsoto13 Posted September 16, 2009 Share Posted September 16, 2009 As some of you know.. I am working on the biggest autocad 2d-3d blocks compilation... I will make it public when I'm done. I have searched in almost every possible place an I've got most of it done... I am going to start now the most difficult part of organizing all the blocks by type from several drawing into specific drawings according to the type.. and I will require some lisp routines to make this task easier... this is the first of 3 thing I might require... maybe none of them is possible... but I am pretty much busy to think about them or look for them in the web... somebody may help to answer these things. I would like to know if is possible to rename all blocks in a drawing with a lisp... I got a file renamer... then I can extract all the blocks and rename them outside in windows.. then bring them back to a drawing with a lisp... but then I will have to order them again... I will be easier to have a lisp to rename all the blocks without touching them in the drawing... Could this be done?... Blocks must be renamed to some preffix and... followed by a number... like... A$C7C493556 renamed to arb_001 A$C2DE23DD0 renamed to arb_002 1 renamed to arb_003.. and so... is it possible? Quote Link to comment Share on other sites More sharing options...
Freerefill Posted September 17, 2009 Share Posted September 17, 2009 There are ways to rename blocks, yes. The question that pops into my mind is, do you want it done completely autonomously, and if so, do you have a specific naming criteria or simply "arb_001 - arb_xxx"? If you want, for example, all of your chairs to have a different prefix than your doors, but if all your blocks are completely randomly named, it would be difficult, if not impossible, to distinguish. Quote Link to comment Share on other sites More sharing options...
gilsoto13 Posted September 17, 2009 Author Share Posted September 17, 2009 There are ways to rename blocks, yes. The question that pops into my mind is, do you want it done completely autonomously, and if so, do you have a specific naming criteria or simply "arb_001 - arb_xxx"? If you want, for example, all of your chairs to have a different prefix than your doors, but if all your blocks are completely randomly named, it would be difficult, if not impossible, to distinguish. Well... what I will do, it's to organize all blocks by type... I don´t want to make a very long list of drawing files... I can start by separating all in ... maybe industrial, commercial and housing...or go by kitchen, dining, living, bathroom, laundry... but the fact is that I wouldn´t like to go very much specific.. I will possibly have a file for both windows and doors and other types of openings... and all blocks in that file will be called as... daw_001, daw_002... and so... the fact is that the lisp must help me to automatically rename all block definitions in the drawing with a prefix and followed by its own number... the main thing I am looking for is to avoid repeating block names in the whole collection, since it will be an incredible number of blocks, maybe 100,000 or something like that... Quote Link to comment Share on other sites More sharing options...
gilsoto13 Posted October 8, 2009 Author Share Posted October 8, 2009 As some of you know.. I am working on the biggest autocad 2d-3d blocks compilation... I will make it public when I'm done. I have searched in almost every possible place an I've got most of it done... I am going to start now the most difficult part of organizing all the blocks by type from several drawing into specific drawings according to the type.. and I will require some lisp routines to make this task easier... this is the first of 3 thing I might require... maybe none of them is possible... but I am pretty much busy to think about them or look for them in the web... somebody may help to answer these things. I would like to know if is possible to rename all blocks in a drawing with a lisp... I got a file renamer... then I can extract all the blocks and rename them outside in windows.. then bring them back to a drawing with a lisp... but then I will have to order them again... I will be easier to have a lisp to rename all the blocks without touching them in the drawing... Could this be done?... Blocks must be renamed to some preffix and... followed by a number... like... A$C7C493556 renamed to arb_001 A$C2DE23DD0 renamed to arb_002 1 renamed to arb_003.. and so... is it possible? Weeell, I want to believe some of you guys forgot it... but you helped a guy who accomplished this task, Lee helped him with the final touch... I just found it yesterday in the swamp.... and I don´t need it yet... I just left one collection of blocks to extract to start the final organization of all the blocks for the complete web collection... so I am on time... glad I finally found all I need to do it.. thanks to Dread Pirate KewlToyZ and Lee Mac for taking the time to finish this useful lisp http://www.theswamp.org/index.php?topic=29839.15 BLR.LSP Quote Link to comment Share on other sites More sharing options...
shmo1234uk Posted October 22, 2010 Share Posted October 22, 2010 i used this once and it worked a treat, went to use it just now and it just came up with error invalid block name?? no blocks renamed? am i doing something worng? Quote Link to comment Share on other sites More sharing options...
Mirtillone Posted June 8, 2017 Share Posted June 8, 2017 This is perfect! Almost. I need the names to be random. I found this random number generator which works just fine but i can not integrate it into the block rename tool you made. (defun C:R01 (/ digits) (setq digits (substr (rtos (rem (getvar 'date) 1) 2 16) 13)) (atof (strcat "0." (substr digits 6) (substr digits 1 5))) ); end defun could you help me? Quote Link to comment Share on other sites More sharing options...
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.