adding layer to dialog

Discussion in 'AutoCAD' started by nalsur8, Feb 16, 2004.

  1. nalsur8

    nalsur8 Guest

    how to put all layer name into 1 list_box dialog
    and then when i select the layer (single or multiple select)
    then enter, the layer selected is on and others layer is off
     
    nalsur8, Feb 16, 2004
    #1
  2. nalsur8

    nalsur8 Guest

    no body know meh!
     
    nalsur8, Feb 16, 2004
    #2
  3. Why not using the standard layer manager?
    Right click to select all, turn them off.
    Select the layer you want and turn that one on.
    Ready.

    Jan
     
    Jan van de Poel, Feb 16, 2004
    #3
  4. nalsur8

    Joe Burke Guest

    Joe Burke, Feb 16, 2004
    #4
  5. nalsur8

    R.K. McSwain Guest

    Are you looking for help in writing this yourself, or are you looking for someone to give you all the code?

    If the former, build a list of layers (filtering out frozen and x-ref layers) using (tblnext), then use (start_list), (mapcar) and (end_list) to add the list of layers to your list_box. Then set your list_box's (action_tile) so that it sets a variable equal to the "nth" item in the list box. Then retreive the "nth" item from your original list of layers. This is the layer name selected by the user

    Then use any method to set that layer current and freeze or turn off all other layers.
    [possibly (command "._LAYER" "_S" mylayer "OFF" "*" "_N" "")]
     
    R.K. McSwain, Feb 16, 2004
    #5
  6. nalsur8

    nalsur8 Guest

    when i call back the dialog box the layer
    became double, when i call back 3,4,5 times all
    layer name repeat

    --
    ----------------------------------------
    Design/Engineering Dept.
    Are you looking for help in writing this yourself, or are you looking for
    someone to give you all the code?

    If the former, build a list of layers (filtering out frozen and x-ref
    layers) using (tblnext), then use (start_list), (mapcar) and (end_list) to
    add the list of layers to your list_box. Then set your list_box's
    (action_tile) so that it sets a variable equal to the "nth" item in the list
    box. Then retreive the "nth" item from your original list of layers. This is
    the layer name selected by the user

    Then use any method to set that layer current and freeze or turn off all
    other layers.
    [possibly (command "._LAYER" "_S" mylayer "OFF" "*" "_N" "")]
     
    nalsur8, Feb 17, 2004
    #6
  7. nalsur8

    R.K. McSwain Guest

    Set your list to nil before compiling the list
     
    R.K. McSwain, Feb 17, 2004
    #7
  8. nalsur8

    Joe Burke Guest

    In other words, make sure any symbol (variable) which is the result of cons or append
    is declared local within the function. Otherwise, each time the function is called,
    you are adding to a global symbol.

    Of course this is just the obvious case where not declaring a symbol local makes a
    mess. All symbols local to the function should be declared as such, unless you have
    good reason to do otherwise.

    Joe Burke


    Set your list to nil before compiling the list
     
    Joe Burke, Feb 17, 2004
    #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.