Event for change active layer in document

Event for change active layer in document

Anonymous
Not applicable
1,000 Views
2 Replies
Message 1 of 3

Event for change active layer in document

Anonymous
Not applicable

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.

0 Likes
Accepted solutions (1)
1,001 Views
2 Replies
Replies (2)
Message 2 of 3

DiningPhilosopher
Collaborator
Collaborator
Accepted solution

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

0 Likes
Message 3 of 3

Anonymous
Not applicable

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

 

Thanks!

Pavel.

0 Likes