Message 1 of 7

Not applicable
05-16-2016
11:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I need help on fixing this lisp where I need to merge any existing layers DIM* to a new layer DIM-N. Then those layer would be removed as it should with the Layer merge command.
Somehow it's not doing it here. Sorry this lisp was not wirtten in a professional manner. Eg. if I don't have DIM5, I don't need to create it, just skip DIM5. All I need is DIM-N only, the rest of DIM* be deleted.
Thanks
Code:
(defun c:LMR (/ ss) (command "-layer" "S" "0" "") (if (not (tblsearch "LAYER" "DIM-N")) (command ".LAYER" "N" "DIM-N" "")) (if (not (tblsearch "LAYER" "DIM1")) (command ".LAYER" "N" "DIM1" "")) (if (not (tblsearch "LAYER" "DIM2")) (command ".LAYER" "N" "DIM2" "")) (if (not (tblsearch "LAYER" "DIM5")) (command ".LAYER" "N" "DIM5" "")) (if (not (tblsearch "LAYER" "DIM10")) (command ".LAYER" "N" "DIM10" "")) (if (not (tblsearch "LAYER" "DIM20")) (command ".LAYER" "N" "DIM20" "")) (if (not (tblsearch "LAYER" "DIM50")) (command ".LAYER" "N" "DIM50" "")) (if (not (tblsearch "LAYER" "DIM100")) (command ".LAYER" "N" "DIM100" "")) ; (command ".-laymrg" "n" "DIM1" "" "n" "DIM-N") (command ".-laymrg" "n" "DIM2" "" "n" "DIM-N") (command ".-laymrg" "n" "DIM5" "" "n" "DIM-N") (command ".-laymrg" "n" "DIM10" "" "n" "DIM-N") (command ".-laymrg" "n" "DIM20" "" "n" "DIM-N") (command ".-laymrg" "n" "DIM50" "" "n" "DIM-N") (command ".-laymrg" "n" "DIM100" "" "n" "DIM-N") (princ "\nLayers merged...") (princ) )
Solved! Go to Solution.