lonelysn Posted April 11, 2019 Posted April 11, 2019 Dear all, Need some help. I have more than 200 Blocks contains Attributes, basically its a legend sheet, all the blocks have attribute texts but in different several layers, i need to bring it to one layer. say i have one light fitting with an attribute text called A1, the block and the attribute text colour are in different layer- both are bylayer. out side block has layer-1 inside block the light fittings has layer-0 (this is bcoz all the lights have same colour) the attribute text has layer-2 (this is because the colour is white so kept it another layer) i have another light fitting with an attribute text called A2, the block and the attribute text colour are in different layer- both are bylayer. out side block has layer-1 inside block the light fittings has layer-0 (this is bcoz all the lights have same colour) the attribute text has layer-3 (this is because the colour is white so kept it another layer) now i want to change both the attribute text layer to layer-4 at once like this i have more than 200 blocks. hoping a glad response/help/advice/solution from all the Gurus here. Thanks lonelysn Quote
ronjonp Posted April 11, 2019 Posted April 11, 2019 So you want all your attributes to be on 'layer-4' ? Post your drawing. Quote
BIGAL Posted April 12, 2019 Posted April 12, 2019 Try this a bit rough needs a check for the attsync so does not do non attributed blocks. (defun AH:ATTS ( / block atts att) (if (not (tblsearch "layer" "layer-4")) (command "-layer" "m" "layer-4" "C" 7 "layer-4" "") ) (vlax-for block (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) (if (not (wcmatch (strcase (vla-get-name block) t) "*_space*")) (progn (vlax-for i block ; Foreach item in block (if (eq (vla-get-objectname i) "AcDbAttributeDefinition");If item is an attribute (vla-put-layer i "layer-4") ) ) (command "attsync" "name" (vla-get-name block)) ) ) ) ) (AH:atts) 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.