Hi, I am having a to do a lot of repetative work and hope there is a way to speed it up.
I am working on and ammeding some drawings. What I need to do is change the blocks onto a different layer and they should pick up that layers attriibutes. Unfortunetly they have not been drawn correctly (in my opinion).
What I am having to do is go into each block in the block editor, selct the objects and change the properties to Colour>ByBlock Layer>0 Linetype>ByBlock. Is there anyway to Automate this or script it. I have heard of LISP but thats where my knowledge ends. Any help witht this would be greatly appreciated as there is a lot of drawings to go.
Hi this is a lisp routine I have found in the autodesk forums some years ago it still works fine. I think you can do what you want with it.
You just call the command by typing Bcolor. It will ask you at first if you want all the objects to go on layer 0 and then it will ask you to choose the color 0=byblock (if I remember well)
hope it helps
I have tried both:
ToanDN the SETBYLAYER command does work in 2010 and seems really useful. I don't think it is the best solution in this instance as it doesn't let me change the objects in the blocks to layer0 or set them to by block if they are set differently.
aghis_no This sounds really ideal. Excuse my ignorance i am a bit of a novice with AutoCad. How do I use the .lsp file? Do I have to put it in a specific folder? If I type bcolor it just says unknow command
To use a lisp file:
1. you have to have the command line visible as you are going to use some user input during the command (most of the lisp apps since they are simple apps they do not use dialog boxes) The command line is visible by default...
2. you either type the command "appload" on the command line or on the ribbon under the manage tab you use the icon named "load application".
3. You will be prompted to locate the file on your hard drive using a classic dialog box. Once the file located on the same dialog box you click on the "load button". This will load the lisp app on the drawing memory but it will not run the app.
4. you type the name of the app on the command line, in our case BCOLOR. Then you will follow the prompts on the command line. It will first ask you to select the blocks at the end of the selection you hit enter, then it will ask you to if you want to put all items on layer 0 (yes/no) then it will ask you for a color (a ? Will give you the list of the options) I think the 0=byblock. Then you hit enter and it's done.
hope it helps
thats great thanks for the in depth explanation.
Everything works perfect apart from one thing:
The linetype: Can anyone amend the .lsp file to include an extra option for changing the linetype as well?......
A big ask I know but I might as well put it out there I'm sure a lot of people must benefit from this.
In recent releases of ACA, if you select a Block and right click, there is a contextual menu choice called Set Nested Entities to ByBlock that will do what you originally asked. Unfortunately, it will change the linetype to ByBlock as well, so if you are looking for a way to set Linetype to ByBlock, that should work for you. If you were trying to keep assigned Linetypes but set everything else to ByBlock, you would need a custom routine for that.
Man I can't believe I haven't noticed that....... So simple thanks.
So I run the bcolor script the will set everything to layer0 and then quick select all the blocks and set nested Entities to ByBlock.
The only issue I have is that it changes the hatches and fills to ByBlock which in some respects is not what I need but I can live with that.
You never know Autodesk might add a USER FRIENDLY interface for block manipulation next time with some sort of user interface with options for this stuff. (and pigs may fly)
I am pretty sure the Set Nested Entities to ByBlock also moves them to Layer 0, but you may want to check that. If so, it could save you a step.