.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Layer management using .net

2 REPLIES 2
Reply
Message 1 of 3
MRiemenCAD
445 Views, 2 Replies

Layer management using .net

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. 

2 REPLIES 2
Message 2 of 3

Hi,

 

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 -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 3
dgorsman
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.
"I don't know" is the beginning of knowledge, not the end.


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost