I have a DWG (attached) with anonymous blocks. The names are "U1", "U2", etc. I cannot go into block editor without specifying the name. The text inside the block had the color manually changed. I want to change the color (or layer) of the text inside the block. The actual drawing I need to edit has 100's of these ****ing things.
How can I change them quickly and uniformly? Thanks for your help!
Hello from France
This routine UNANON does the job but one block by one block !
http://www.draftsperson.net/index.php?title=Anonymous_Blocks_in_AutoCAD
Sorry I have not a multiple block routine !?
If you find one, I am ready to use it !
Patrice BRAUD
@m_rogoff wrote:
I have a DWG (attached) with anonymous blocks. The names are "U1", "U2", etc. I cannot go into block editor without specifying the name. The text inside the block had the color manually changed. I want to change the color (or layer) of the text inside the block. The actual drawing I need to edit has 100's of these ****ing things.
How can I change them quickly and uniformly? Thanks for your help!
(defun tolayer (lay) (if (tblsearch "layer" lay) (vlax-for b (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)) ) (if (and (eq (vla-get-ObjectName b) "AcDbBlockTableRecord") (wcmatch (Vla-get-name b) "`*U*") ) (vlax-for o b (if (and (vlax-write-enabled-p o) (eq (vla-get-objectname o) "AcDbMText") ) (progn (vla-put-layer o lay) (vla-put-color o acByLayer) ) ) ) ) ) (princ "\n<<Layer Does not Exist>>") ) (vla-regen (vla-get-activedocument (vlax-get-acad-object)) acActiveViewport ) (princ) ) (vl-load-com) (princ)
HTH
Hello
I am a STUPID boy because I have not seen the UNANONALL command
which immediately "convert" the 7 *U blocks of the OP to 7 named blocks (TEMP1-TEMP7) !!
I have always use this routine for ONE Block !?
Congratulations and Kudos for you !
Patrice BRAUD
Hello from France
YES I know that we have to be very careful with some anonymous Blocks !
Thks
Patrice BRAUD
run it like this.
Command: (tolayer "Layername")