- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am new to lisp (and this forum) so please excuse the very basic question.
I am using Plant3D and wanted to use lisp to find layer groups and isolate them.
My layers are organised by a naming structure ie C-xx Civil layers S-xx Structural layers E-xx Equipment layers etc.
I have started with the following code, which works for a single input. What I would like to do is put it inside a while loop so I can isolate several layer groups ie. C- & E- to isolate all the Civil and Equipment layers. But I can't work out a format that works. Would anyone be able to give me any advice?
Philip
;laygroupshow * lisp to show all layers that start with the characters entered by the user ie isolate all civil layers by entering C-
(defun C:laygroupshow()
(setq MyLaygroup (getstring T "\n Enter initial search text: ie C- :-")) ; Prompt for search text
(setq MyLaygroup (strcat MyLaygroup "*")) ; Add Wildcard * to end of string
(setq sel1 (ssget "X" (list (cons 8 MyLaygroup)))) ; Set sel1 to layers that match search condition
(command "ISOLATEOBJECTS" sel1 "") ;isolate selected objects
(princ)
)
Solved! Go to Solution.