TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Dave M on January 12, 2017, 11:51:14 AM

Title: Change Layer Properties By Object Selection
Post by: Dave M on January 12, 2017, 11:51:14 AM
I have a routine (not written by me) that will allow one to change a layer's properties by selecting an object on the layer you want to change the properties of.  It will even work if the layer is nested in an xref or block.  It does not work in 2016, and it is protected so I can't modify it myself. 


Does anyone know of a similar routine that would work in 2016?


Thanks!
Title: Re: Change Layer Properties By Object Selection
Post by: jvillarreal on January 17, 2017, 09:30:44 AM
Here's a modified routine shared by Vovka several years ago. I tried to add layer mod functionality to a dynamic info tool. It could definitely use an update.
Title: Re: Change Layer Properties By Object Selection
Post by: jvillarreal on January 17, 2017, 09:46:25 AM
Something to note: With the tool I shared, you'll have to double click linetypes and lineweights before hitting ok in their respective dialogs. (It was a workaround.)
Title: Re: Change Layer Properties By Object Selection
Post by: alanjt on January 18, 2017, 01:10:25 PM
Something to note: With the tool I shared, you'll have to double click linetypes and lineweights before hitting ok in their respective dialogs. (It was a workaround.)
That's pretty slick thinking.
Title: Re: Change Layer Properties By Object Selection
Post by: jvillarreal on January 18, 2017, 01:43:47 PM
Thanks brother, but it wasn't my idea. I don't recall where I read about it or copied the necessary code as this was hacked together at least 5 years ago.

I'd use this routine a lot more often if it were updated to work with Civil 3d styles. Just haven't taken the time.
Title: Re: Change Layer Properties By Object Selection
Post by: jvillarreal on March 10, 2017, 03:15:08 PM
Looking at updating or adding to this code. Anyone know of a way to access civil 3d object layers by selection? (layer a profile alignment or grid line resides on for example)

is a programmatic explode/undo workaround the only option with lisp?
Title: Re: Change Layer Properties By Object Selection
Post by: jvillarreal on March 16, 2017, 06:44:28 PM
Seems to work without issue..
Title: Re: Change Layer Properties By Object Selection
Post by: MSTG007 on March 17, 2017, 10:22:06 AM
Dude, That is cool...