Message 1 of 2
Group selection set based on dxf codes (layer name, color or layer type)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
As a beginner, I have done something I have been trying for a long time: group a full selection set based on their dxf code values. If you think this can be more clean, please feel free to let me know.
Attaching the code for anyone's reference:
(defun c:slection_sets()
(setvar "osmode" 0)
(alert "Select your Ground floor plan")
(setq groundfloor (ssget))
(setq entities (list))
(setq entities (append (list (ssname groundfloor 0)) entities))
(setq in 0)
(while (< in (sslength groundfloor))
(setq count 1)
(foreach k entities
(if (and (equal (assoc 0 (entget (ssname groundfloor in))) (assoc 0 (entget k))) (equal (assoc 8 (entget (ssname groundfloor in))) (assoc 8 (entget k))) (equal (assoc 62 (entget (ssname groundfloor in))) (assoc 62 (entget k))))
(progn
(princ "T")
(setq count (+ count 0))
)
(progn
(princ "F")
(setq count (1+ count))
)
)
)
(princ "\n")
(if (> count (length entities))
(setq entities (append (list (ssname groundfloor in)) entities))
)
(setq in (1+ in))
)
)