.NET

.NET

Reply
Active Contributor
pva75
Posts: 48
Registered: ‎07-22-2012
Message 1 of 3 (185 Views)
Accepted Solution

Event for change active layer in document

185 Views, 2 Replies
08-24-2012 11:58 AM

Hi all,


Is there event for change current (active) layer of document?
(it's not Database.ObjectModified - it's not raised).


I tried to do it with binding as:

  public void Initialize()
  {
    var layerList = Application.UIBindings.Collections.Layers;
    layerList.PropertyChanged += new PropertyChangedEventHandler(LayerList_PropertyChanged);

 

And -= in Terminate, but... Autocad 2012 chashed _sometimes_!!!
Impossible to understand when it happned...
So I reject this way.

 

Is there other way to handle this event?

 

Thanks,
Pavel.

Have you tried handling the system variable changed event, watching for the CLAYER system variable?

Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 2 of 3 (176 Views)

Re: Event for change active layer in document

08-24-2012 02:35 PM in reply to: pva75

Have you tried handling the system variable changed event, watching for the CLAYER system variable?

Active Contributor
pva75
Posts: 48
Registered: ‎07-22-2012
Message 3 of 3 (160 Views)

Re: Event for change active layer in document

08-24-2012 09:48 PM in reply to: DiningPhilosopher

It's super idea! It woks fine and not crashed.

 

Thanks!

Pavel.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.