AutoCAD Architecture General

Reply
Contributor
Posts: 13
Registered: ‎10-10-2008
Message 1 of 10 (462 Views)

Changing block contents

462 Views, 9 Replies
02-14-2011 04:25 AM

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

Valued Contributor
Posts: 75
Registered: ‎04-24-2006
Message 2 of 10 (447 Views)

Re: Changing block contents

02-14-2011 12:27 PM 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

*Expert Elite*
ToanDN
Posts: 1,849
Registered: ‎09-26-2006
Message 3 of 10 (441 Views)

Re: Changing block contents

02-14-2011 03:17 PM 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).

Contributor
Posts: 13
Registered: ‎10-10-2008
Message 4 of 10 (427 Views)

Re: Changing block contents

02-15-2011 02:14 AM in reply to: greg.steel

Thanks folks, I'll give them a try.

Contributor
Posts: 13
Registered: ‎10-10-2008
Message 5 of 10 (424 Views)

Re: Changing block contents

02-15-2011 02:27 AM 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

 

Valued Contributor
Posts: 75
Registered: ‎04-24-2006
Message 6 of 10 (420 Views)

Re: Changing block contents

02-15-2011 03:13 AM 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

Contributor
Posts: 13
Registered: ‎10-10-2008
Message 7 of 10 (418 Views)

Re: Changing block contents

02-15-2011 03:45 AM 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.

*Expert Elite*
Posts: 2,322
Registered: ‎12-09-2003
Message 8 of 10 (356 Views)

Re: Changing block contents

02-17-2011 03:56 AM 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
Contributor
Posts: 13
Registered: ‎10-10-2008
Message 9 of 10 (351 Views)

Re: Changing block contents

02-17-2011 04:25 AM 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) :smileyvery-happy:

 

Thanks all

*Expert Elite*
Posts: 2,322
Registered: ‎12-09-2003
Message 10 of 10 (336 Views)

Re: Changing block contents

02-17-2011 04:12 PM 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you interested in helping shape the Autodesk Community?
We’re looking at a few different ways to improve the “All Forums” landing page and need your feedback! If interested, please take a few minutes to fill out the following Usability Study. Thank you for your time!

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community