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

changing layers FROM bylayer

9 REPLIES 9
Reply
Message 1 of 10
js200
716 Views, 9 Replies

changing layers FROM bylayer

Hello,

 

I understand the options for changing multiple layer properties TO bylayer, but wonder if anyone knows how to do the opposite (FROM bylayer to current color, line and type).  Want to do this for say 200 layers with a simple command.  Any ideas?

 

Thanks,

Joe

Tags (2)
9 REPLIES 9
Message 2 of 10
LyleHardin
in reply to: js200

Layers or entities? 

Entities can be Bylayer, Byblock, or of certain colors.

Layers can only be colors... not Bylayer.

 

If you wan to change all layer colors, you can do it with the Layer Properties Manager, or through clever use of the command -LAYER.

 

To change all etities to a certain color, use the Properties Manager or the CHPROP command.

 

Do you want to change all entities to the color of the layer they reside on? 

That's just insane, but I guess you have your reasons... 😉

That would be a rather simple LISP routine if someone has time to write one.

Otherwise, I'd sort the Layer Manager by color, select all the layers of the same color, turn off the rest, and use the Properties Manager or CHPROP command to change their colors.

The thought of actually doing that really makes me shudder, though...  It goes against all I beleive in.

Message 3 of 10
js200
in reply to: LyleHardin

Thanks for the reply hardin!  I suppose it is the properties of the entities that I am looking to change from "ByLayer" to whatever color, line width and line type they are currently in.  If the properties of my layers and entities were more similar I think your solution of sorting through the layer manager would be a great option.  My layers are unfortunately more different than similar and there are more than I would prefer to go through by hand to make this change.

 

Ideally, I would like to perform a mass uncoupling of the entity properties from the "ByLayer" setting for the entire drawing.  I need to do this because I need the whole drawing to be on one layer for our GIS guys to use it as a basemap in their system, and I can't have the different entities take on different properties when I merge them into one layer.  So we can blame the GIS guys for forcing this CAD no-no on me 😉

 

Any ideas?

Message 4 of 10
LyleHardin
in reply to: js200

Ah... you said the magic word. Merge.

If you have AutoCAD 2014 or 2015, you can select all the layers you want in the Layer Manager, Right Click, and select Merge Layers.

You are then presented the option of what layer you want things to be on.

 

But, as I type this, I see you're dilema. You don't want Everything to be White on one layer... You want everything to be on one layer, but still  have different colors and linetypes so you can still tell what they are.  Similar to Microstation, I guess. My previous solution wouldn't be bad if you only had 6 colors. But if you have dozens of colors and linetypes, then it would be quite a task.

 

Let me look through my 20+ year arsenal of LISP routines... I bet I might have something that might help.

 

Message 5 of 10
js200
in reply to: LyleHardin

Thanks hardin!  Really appreciate it!!

Message 6 of 10
Kent1Cooper
in reply to: js200


@js200 wrote:

.... 

I understand the options for changing multiple layer properties TO bylayer, but wonder if anyone knows how to do the opposite (FROM bylayer to current color, line and type).  Want to do this for say 200 layers with a simple command.  Any ideas?

....

it is the properties of the entities that I am looking to change from "ByLayer" to whatever color, line width and line type they are currently in.

There's a routine called BEL0CL.lsp here [attached to the last message from me on that thread], that was built to do exactly that to all entities inside Block definitions.  Are you knowledgeable enough to adjust it to do so to all entities in a drawing, or do you need help with that?  It only takes care of Color and Linetype, but could be expanded to include Lineweight, too.

Kent Cooper, AIA
Message 7 of 10
js200
in reply to: Kent1Cooper

Thanks Kent!  I'm not familiar with the LISP programming language.  I've programmed in other languages such as python so the syntax I can pick up, but wouldn't know what to change written in the script itself (blkss, blokobj, blkname, blknames, etc.) to make them refer to entities instead of blocks.  Would you just replace any "blk" with "ent"?  Any further advice you have to revising the script would be great and I appreciate you forwarding this along regardless!

Message 8 of 10
Kent1Cooper
in reply to: js200

It's more a question of leaving a lot of it out than changing some variable names, since pretty much of it is about selecting Blocks and getting their names and opening their definitions, none of which you would need.  Although, thinking about it, you probably would want to do it to the pieces in all Block definitions in a drawing, in addition to all the top-level objects; otherwise the objects nested in Blocks won't be "fixed."  So maybe it should be a combination, which would expand that routine rather than shrink it.  I will try to play with that over the weekend, but can't right now.

Kent Cooper, AIA
Message 9 of 10
LyleHardin
in reply to: Kent1Cooper

Here's your solution. Looks like someone wanted the same thing just a few days ago.

 

http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-each-object-entity-from-bylaye...

 

I copied the code, saved it as a LISP routing ( .lsp) and it seems to work fine.

 

Give some Kudos to pbejse.

 

 

Message 10 of 10
js200
in reply to: LyleHardin

That's the ticket hardin.  Works like a charm!

 

Thanks to both you guys for your help!!

 

Joe

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

Post to forums  

Autodesk Design & Make Report

”Boost