Bobzy20 Posted August 23, 2018 Share Posted August 23, 2018 (edited) Hi This 3D block doesn't wont to change colour at all, it wont allow me to go into Block Editor either. I'm trying to put it on the block onto layer: G541-M_General lighting so it matches that layer colour. Seems easy? Block-Test.dwg Edited August 23, 2018 by Bobzy20 Quote Link to comment Share on other sites More sharing options...
rkmcswain Posted August 23, 2018 Share Posted August 23, 2018 It's an anonymous block. Can you explode it, change the properties as needed, then make it into a regular named block? Would that work for you? Quote Link to comment Share on other sites More sharing options...
Cad64 Posted August 23, 2018 Share Posted August 23, 2018 I'm pretty sure it's because of the block name, *U1. Blocks with an asterisk preceding the name cannot be modified. I would explode the block and then reblock it. Quote Link to comment Share on other sites More sharing options...
Bobzy20 Posted August 23, 2018 Author Share Posted August 23, 2018 Thanks, I could do that but I have 100's more that will need changing, perhaps a script to force it would be good. Set by layer does nothing in this case. Quote Link to comment Share on other sites More sharing options...
Cad64 Posted August 23, 2018 Share Posted August 23, 2018 You could do a search for a lisp routine to rename anonymous blocks. There are some out there, but I haven't used any so I can't recommend one. Or, post a question in the Lisp section. I'm sure someone could probably write one or point you to one. Quote Link to comment Share on other sites More sharing options...
Jef! Posted August 24, 2018 Share Posted August 24, 2018 On 8/23/2018 at 10:03 AM, Bobzy20 said: Thanks, I could do that but I have 100's more that will need changing, perhaps a script to force it would be good. Set by layer does nothing in this case. Hi there. Nah, for entities inside a block, if you want them to be of the color of the layer on which the block is inserted, the entities need to be "byblock"! Here's a snippet that will modify all blocks named *U* and put everything inside by block. It might have unwanted effects if you have other *u blocks that you don'T want to handle like that (like modified dyn blocks). It also doesn'T go inside nested blocks, but it works fine on your drawing sample. (defun c:ufix ( / acdoc regen) (vlax-for blk (vla-get-Blocks (setq acdoc (vla-get-ActiveDocument (vlax-get-acad-object)))) (if (wcmatch (vlax-get-property blk 'name) "`*U*") (vlax-for ent blk (if (and (vlax-property-available-p ent 'color T) (not (= 0 (vlax-get-property ent 'color))) ) (progn (vlax-put-property ent 'color 0) (setq regen T) ) ) ) ) ) (if regen (vla-regen acdoc acAllViewports)) (princ) ) Try it and let me know how it works for you Cheers 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.