- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hiho
I would like to use the following Lisp code to select all objects on a layer with one click. When I run the Lisp again, I want to select another layer, which will be added to the already selected objects.
Unfortunately, my Lisp doesn't work as expected, either with 'ssgetfirst' or when 'ssget' returns 'nil':
(defun c:test ()
(setq CurSel (ssget)) ; Aktuelle Auswahl speichern
(setq TargAus (car (entsel "\nSelect object on layer to select: ")))
(setq TargLay (assoc 8 (entget TargAus)))
(setq LaySel (ssget "_X" (list TargLay)))
(setq numObjs (sslength LaySel))
(setq i 0)
(while (< i numObjs)
(setq obj (ssname LaySel i))
(setq CurSel (ssadd obj CurSel))
(setq i (1+ i))
)
(sssetfirst nil CurSel)
(princ)
)
---
The same i want make with blocks/dym-blocks.
Whats wrong with the lisp, can someone help me?
Warm regards
Emanuel
Solved! Go to Solution.