Add Layers to layer list?

Discussion in 'AutoCAD' started by Timothy Spangler, Aug 14, 2003.

  1. I want to be able to add layer names to the layer list if they are not there
    already i.e..

    I have a list of layers in the current drawing
    Layer1
    Layer2
    Layer3

    I want to show those layers plus
    Layer10
    Layer11

    I want these to show in a dropdown list so if they are selected then they
    will be created.

    What I have now is:
    ;;; ------------ Set Layer List
    (defun set_lay_list (tile / curr_lay index next_lay)

    (start_list tile)
    (setq lay_list '())
    (setq next_lay (tblnext "layer" T))
    (setq index 0)
    (while next_lay
    (if (= (getvar "clayer") (cdr (assoc 2 next_lay)))
    (setq curr_lay index)
    (setq index (1+ index))
    )
    (setq lay_list (append lay_list(list (cdr (assoc 2 next_lay)))))
    (setq next_lay (tblnext "layer"))
    )
    (if (not(member "Layer10" lay_list))
    (setq lay_list(append '("A-Wall-Window") lay_list)); Add new layers to the
    current list
    )

    (mapcar 'add_list lay_list)
    (end_list)
    )

    TIA

    --
    _________________________________
    Timothy Spangler

    "You cannot escape the responsibility of tomorrow by evading it today"
    Abraham Lincoln
    _________________________________

    AutoCAD 2002
    WinXP
    Compaq Evo W6000
    Intel Xeon / 1G RAM
     
    Timothy Spangler, Aug 14, 2003
    #1
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.