Valued Contributor
Posts: 65
Registered: ‎03-31-2003
Message 1 of 3 (289 Views)

Layer management using .net

289 Views, 2 Replies
12-09-2011 04:03 PM

I'm moving our DB driven layer management from VBA to .net and want some advice on the appropriate way to handle this. 


In VBA we monitor command events and depending on the command initiated, we access a layers DB and compare the command to a list of command-to-layer pairings and then set the active layer that the eventual object is created onto. Once the command completes properly it reverts back to the previously active layer. Most of the layer operations are invisible to our users, they just know text is always on a certain layer, dimensions, viewports, etc. 


Moving to .Net, and reviewing the event handler information, I'm curious when the appropriate time is handle the movement of an object to a managed layer:

1. When the command is initiated?

2. After the object is created and then the layer handled retroactively? 

3. other?


The event handler information makes me think that I cant count on operational sequence to do this like before.


Would appreciated any advice you could offer. 

*Expert Elite*
Posts: 9,071
Registered: ‎06-29-2007
Message 2 of 3 (266 Views)

Re: Layer management using .net

12-10-2011 01:15 AM in reply to: MRiemenCAD



as far as I understand I would:

  • gather the objects (the ObjectID's) appended during the Database.ObjectAppended -event
  • modify their layers in the CommandEnded -event.


- alfred -

Ingenieur Studio HOLLAUS ... www.hollaus.at
*Expert Elite*
Posts: 5,367
Registered: ‎10-12-2006
Message 3 of 3 (225 Views)

Re: Layer management using .net

12-12-2011 11:25 AM in reply to: MRiemenCAD

Given that most methods place objects on the active layer, I would suggest making the appropriate layer active before the object is added.  Makes the operational procedure a little more clear, and avoids having to check to see if the currently active layer is off or locked.

If you are going to fly by the seat of your pants, expect friction burns.
Adopt. Adapt. Overcome. Or be overcome.
A good question will be halfway to a good answer.

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.