• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    .NET

    Reply
    Valued Contributor
    iwcwoodworker
    Posts: 59
    Registered: ‎03-31-2003

    Layer management using .net

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

    Please use plain text.
    *Expert Elite*
    Posts: 6,474
    Registered: ‎06-29-2007

    Re: Layer management using .net

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

    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
    -------------------------------------------------------------------------
    Please use plain text.
    *Expert Elite*
    dgorsman
    Posts: 3,297
    Registered: ‎10-12-2006

    Re: Layer management using .net

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

    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.


    Please use plain text.