.NET

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

Event for change active layer in document

172 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.

Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 2 of 3 (163 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 (147 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.

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.