AutoCAD Architecture Forum
Welcome to Autodesk’s AutoCAD Architecture Forums. Share your knowledge, ask questions, and explore popular AutoCAD Architecture topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing block contents

9 REPLIES 9
Reply
Message 1 of 10
greg.steel
752 Views, 9 Replies

Changing block contents

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.

 

Thanks

9 REPLIES 9
Message 2 of 10
aghis_no
in reply to: greg.steel

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

aghis

Message 3 of 10
ToanDN
in reply to: greg.steel

What version?  Try SETBYLAYER command if you are on 2011 (I don't remember if 2010 has it or not).

Message 4 of 10
greg.steel
in reply to: greg.steel

Thanks folks, I'll give them a try.

Message 5 of 10
greg.steel
in reply to: greg.steel

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

 

Thanks again

 

Message 6 of 10
aghis_no
in reply to: greg.steel

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

aghis

Message 7 of 10
greg.steel
in reply to: aghis_no

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.

Message 8 of 10
David_W_Koch
in reply to: greg.steel

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.


David Koch
AutoCAD Architecture and Revit User
Blog | LinkedIn
EESignature

Message 9 of 10
greg.steel
in reply to: greg.steel

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) Smiley Very Happy

 

Thanks all

Message 10 of 10
David_W_Koch
in reply to: greg.steel

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.


David Koch
AutoCAD Architecture and Revit User
Blog | LinkedIn
EESignature

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

Post to forums  

Autodesk Design & Make Report

”Boost