.NET

.NET

Reply
Active Contributor
48 Posts
2 Kudos
Registered: ‎07-22-2012
Post 1 of 3
Accepted Solution

Event for change active layer in document

190 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
370 Posts
175 Kudos
Registered: ‎05-06-2012
Post 2 of 3

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
48 Posts
2 Kudos
Registered: ‎07-22-2012
Post 3 of 3

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
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!