Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.
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?
Solved! Go to Solution.
Solved by RobDraw. Go to Solution.
The Command Setbylayer should do the trick.
Mark this as solved if it helps!
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.
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?
@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.
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:
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.
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 🙂
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.
@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.
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 🙂
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,
For some reason I understood what he was after gave the right answer but without the right guidance..lol
@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.
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.