Change block objects and nested blocks to one colour

Change block objects and nested blocks to one colour

Anonymous
Not applicable
12,343 Views
13 Replies
Message 1 of 14

Change block objects and nested blocks to one colour

Anonymous
Not applicable

Hello guys, i was searching for a lisp that could change all objects and blocks inside a main block to the same colour keeping all the other properties (like layer, linetype, lineweight) with no changes. Just only to force all objects colour to a desire one that could be red, blue, 251 grey or 8 grey or some other colour.

I found some interesting lisps but only for change layers to "Layer 0" but it doesn't keep linetypes and lineweights because it turns all the other properties to "by layer" or "by block".

Could anyone help me please?

 

 

0 Likes
Accepted solutions (1)
12,344 Views
13 Replies
Replies (13)
Message 2 of 14

ferdi.jafar
Enthusiast
Enthusiast

The Command Setbylayer should do the trick.

 

Mark this as solved if it helps!

Message 3 of 14

RobDraw
Mentor
Mentor

SETBYLAYER probably won't do the trick unless the desired color is the same as all of the layer colors within the blocks. You should try asking this over in the Customization and LISP forum as this will definitely require coding.


Rob

Drafting is a breeze and Revit doesn't always work the way you think it should.
0 Likes
Message 4 of 14

ferdi.jafar
Enthusiast
Enthusiast

Hey Rob,


But if i am not mistaken he said he wants to change all the objects in that specific block, so if he selects that one block and run the set by layer, would not that give the desired result?

0 Likes
Message 5 of 14

RobDraw
Mentor
Mentor

@ferdi.jafar wrote:

Hey Rob,


But if i am not mistaken he said he wants to change all the objects in that specific block, so if he selects that one block and run the set by layer, would not that give the desired result?


 

That is only if all the layers in that block have the desired color already assigned to them. The OP wants to be able to assign a specific color regardless of the color assigned to the layer.

 

So, it might work on simple blocks and the layers have the correct color. It is by no means a blanket solution for all blocks.


Rob

Drafting is a breeze and Revit doesn't always work the way you think it should.
0 Likes
Message 6 of 14

АлексЮстасу
Advisor
Advisor

Try BGBLFIX from the attached bgtools3.3.lsp (https://forum.dwg.ru/showthread.php?t=66355
https://lispbox.wordpress.com/2014/12/03/bgtools-background-tools-v-2-31-copyright-2009-2014/).
With such parameters:

Change_Color.png
I chose to assign a ByBlock color ("Цвет" "поблоку") so that the color can be controlled from outside the block. If the blocks use a layer other than 0, these elements may have a layer color.
Lisp created by VVA, Vladimir Azarko in 2009-14.

 


-- Alexander, private person, pacifist, english only with translator 🙂 --

Object-modeling _ odclass-odedit.com _ Help

0 Likes
Message 7 of 14

Anonymous
Not applicable

Hi ferdi.jafar

Thankyou for your reply but as i said, i want to keep all the other properties as they are like "hidden" linetypes and different lineweights. With "setbylayer" it changes all objects properties to "by layer" and i only want to change the colour. I even could enter de block and select all objects and change the colour but inside the big block i have a lot of diferent little blocks with different colours and i want to change only the colour without having to enter inside of each little block that i have.

Hope i made me understand 🙂

0 Likes
Message 8 of 14

ferdi.jafar
Enthusiast
Enthusiast

Paiakan,

 

I would imagine the drawing was created by someone else and you want to change the colors so you can xref it to your drawing? If that is the case, personally if you have LT and the drawing is for information purpose only I would explode everything and change the color to what you want. However, if it is your drawing then I would suggest to create layers and organize everything that way afterwards it will help you change colors linetypes, lineweights much more easier.

Hope this helps.

0 Likes
Message 9 of 14

RobDraw
Mentor
Mentor
Accepted solution

@Anonymous wrote:

Hi ferdi.jafar

Thankyou for your reply but as i said, i want to keep all the other properties as they are like "hidden" linetypes and different lineweights. With "setbylayer" it changes all objects properties to "by layer" and i only want to change the colour.


 

If you wanted the color to be layer, you should have said so.

 

SETBYLAYER has settings that allow you to have it only change the color. 

 

SETBYLAYER.jpg


Rob

Drafting is a breeze and Revit doesn't always work the way you think it should.
Message 10 of 14

Anonymous
Not applicable

Thankyou RobDraw,

Dindn't read the prompt messege in the command line to see the comand settings 😅

That is all i need, thankyou very much 🙂

0 Likes
Message 11 of 14

RobDraw
Mentor
Mentor

In your OP you stated that you wanted to change everything to a specific color and gave a list of colors. That was very misleading. ByLayer is not a color and you should have said that instead of "red, blue, 251 grey or 8 grey or some other colour". You could have gotten your solution in the first reply if you had asked your question correctly.


Rob

Drafting is a breeze and Revit doesn't always work the way you think it should.
0 Likes
Message 12 of 14

ferdi.jafar
Enthusiast
Enthusiast

Rob,


For some reason I understood what he was after gave the right answer but without the right guidance..lol

0 Likes
Message 13 of 14

RobDraw
Mentor
Mentor

@ferdi.jafar wrote:

For some reason I understood what he was after gave the right answer but without the right guidance.


 

Even a stopped clock is right twice a day.

 

You answer did not include changing the settings. An incomplete answer is not a solution.


Rob

Drafting is a breeze and Revit doesn't always work the way you think it should.
0 Likes
Message 14 of 14

Anonymous
Not applicable

The main block comes from an other cad software and it creates various blocks.  I import it as an xref and then a bind it to my dwg file. im not the only one working with the new file so, electrical, trees and other blocks and layers have to be in the drawing to freeze them or not and i cannot explode all the blocks because some times it comes with many buildings with hatches and you know if you explode a entire heavy drawing it becomes heavier and may be difficult to work. Though the xref is only for information purposes sometimes i have information undergruond or under bridges that it is suposed to appear in the drawing, that's why i need to keep original linetypes 😅

I really apreciate your help, didn't see all the possibilities of the "setbylayer" command at first 
Thankyou very much 🙂

0 Likes