Message 1 of 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all, I'm trying to add simple foolproof interface enhancements to a program that I have stitched together and I have a simple enough request. Does anyone know how I can take a list of layer names I'm making available to a pop_list and pare it down to display only the layers that are thawed, unlocked, on, and non x-ref layers? I'd like to present the users with only a list of valid layers to place my blocks on.
Up to this point, I'm just using this old Autolisp method to get a layer list...
(start_list "layer_pop_list") (setq layer_list '() next_list (tblnext "Layer" T) index 0 ) (while next_list (if (= (getvar "clayer") (cdr (assoc 2 next_list))) (setq new_index index index (1+ index) ) ) (setq layer_list (append layer_list (list (cdr (assoc 2 next_list)))) next_list (tblnext "Layer") ) ) ;try to filter layer list here ;(setq good_layer_list layer_list) (mapcar 'add_list layer_list) (end_list) (set_tile "layer_pop_list" (ITOA new_index))
Most programmers would probably know how to do this easily, but I'm getting rusty after spending so much time on building libraries.
ADN CAD Developer/Operator
Solved! Go to Solution.