accessing layer states manager

Discussion in 'AutoCAD' started by jlspartz, Nov 2, 2004.

  1. jlspartz

    jlspartz Guest

    Does anyone know how to access the layer states manager? I'm not talking about the layer manager (lman). I am talking about the one within the layer manager. Can you access that screen through the command line? I want to delete all layer states within THAT layer manager.
     
    jlspartz, Nov 2, 2004
    #1
  2. jlspartz

    Doug Broad Guest

    If you are speaking about 2005:
    From the help files:

    GetInterfaceObject("AutoCAD.AcadLayerStateManager.16")



    In lisp that translates to:

    (vla-get-interfaceobject (vlax-get-acad-object) "AutoCAD.AcadLayerStateManager.16" )



    Try to remember to indicate which version you are using or want help with when you post.



    Hope that helps.
     
    Doug Broad, Nov 3, 2004
    #2
  3. jlspartz

    doug k Guest

    it may help jlspartz, but it doesn't quite help me.

    I just want the dadburn layer state dialog box to pop up without having to
    enter the layer manager first.
    I've asked for this shortcut before, and seen others ask, with no takers. I
    was beginning to think it impossible.

    Is there a way to use that to call up the command without having to rebuild
    everything?


    (LDDT2005)
     
    doug k, Nov 3, 2004
    #3
  4. jlspartz

    Doug Broad Guest

    Doug,
    You can delete layer states with Robert's program but I
    am unaware of a direct connection to the layer states dialog
    or a command line variant.

    You could always build your own dialog but as for me, that
    seems like a waste of time. Get a faster computer. ;-)

    Maybe someone else will know.

    Regards,
    Doug
     
    Doug Broad, Nov 3, 2004
    #4
  5. jlspartz

    GTVic Guest

    It sounds like you really want a LISP routine that just deletes all the layer states in the current drawing (layer states as listed in the Layer States Manager dialog).

    I know of a LISP routine that does this for the LMAN settings so this should be possible for the layer states manager data as well.

    But what you are asking for is a LISP command or some other command that will open the dialog for you so you can delete the layers yourself. The keyboard entry for this is:

    la<Enter><Alt-S>

    So not much point in automating that with LISP, plus as you guessed it cannot be done. Some dialogs are created with DCL and accessed via LISP and you could create your own LISP to acess these dialogs but the Layer dialog and sub-dialogs are not (see all the complaints regarding .NET and the layer dialog).
     
    GTVic, Nov 3, 2004
    #5
  6. jlspartz

    doug k Guest

    its not the box that is slow (well...not too slow), it is just one of those
    "two-clicks" things that I would prefer need only one.

    I may just program my keyboard to get me there.......
     
    doug k, Nov 3, 2004
    #6
  7. jlspartz

    jlspartz Guest

    Well, actually to make this more clear. I'm using ADT2005 and I would like to do both things that are being talked about in this topic.

    1. Accessing the layer manager dialog box with one click, instead of two.

    2. Deleting all layer manager states within that layer manager with a lisp routine.
     
    jlspartz, Nov 3, 2004
    #7
  8. jlspartz

    sourdoug Guest

    This works for acad layerstate manager
    begin code below from M Perry in Alaska

    ;;; Delete all Layer states
    (defun c:dls (/ nme lsList)
    (setq ddd "")
    (setq ddd (getstring "\nDo you want ERASE ALL LAYERSTATES (Y)<Y> ? "))
    (if (= ddd "")
    (progn
    (setvar "cmdecho" 0)(graphscr)
    (princ"\n*** Layer State List ***")
    (vlax-for x
    (vla-item
    (vla-GetExtensionDictionary
    (vla-get-layers
    (vlax-get-property
    (vlax-get-acad-object)
    'activedocument)
    )
    )
    "ACAD_LAYERSTATES"
    )
    (princ(strcat "\n Delete all LayerState :" (setq nme(vlax-get x 'name))))
    (command "-layer" "state" "delete" (setq nme(vlax-get x 'name)) "" "")
    (setq lsList (cons nme lsList))
    )

    )
    )
    (princ)
    );end of defun
     
    sourdoug, Mar 10, 2005
    #8
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.