Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change block objects and nested blocks to one colour

13 REPLIES 13
SOLVED
Reply
Message 1 of 14
Anonymous
6557 Views, 13 Replies

Change block objects and nested blocks to one colour

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?

 

 

Tags (3)
13 REPLIES 13
Message 2 of 14
ferdi.jafar
in reply to: Anonymous

The Command Setbylayer should do the trick.

 

Mark this as solved if it helps!

Message 3 of 14
RobDraw
in reply to: Anonymous

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.
Message 4 of 14
ferdi.jafar
in reply to: RobDraw

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?

Message 5 of 14
RobDraw
in reply to: ferdi.jafar


@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.
Message 6 of 14
АлексЮстасу
in reply to: Anonymous

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

Message 7 of 14
Anonymous
in reply to: ferdi.jafar

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 🙂

Message 8 of 14
ferdi.jafar
in reply to: Anonymous

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.

Message 9 of 14
RobDraw
in reply to: Anonymous


@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
in reply to: RobDraw

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 🙂

Message 11 of 14
RobDraw
in reply to: Anonymous

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.
Message 12 of 14
ferdi.jafar
in reply to: RobDraw

Rob,


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

Message 13 of 14
RobDraw
in reply to: ferdi.jafar


@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.
Message 14 of 14
Anonymous
in reply to: ferdi.jafar

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 🙂

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report