Changing "Pickadd" to 0, 1 or 2 has no effect...
Adding "(sssetfirst nil nil)" has no effect...
Here's the code I'm using:
(defun SELECTLINKED (/ C C2 ENT ENTSET LINKEDSET SOURCESET)
(setq SOURCESET (ssget))
(setq LINKEDSET (ssadd))
(setq C 0)
(while (< C (sslength SOURCESET))
(setq ENT (ssname SOURCESET C))
(setq ENTSET (RFL:GETALLENT ENT))
(setq C2 0)
(while (< C2 (sslength ENTSET))
(ssadd (ssname ENTSET C2) LINKEDSET)
(setq C2 (1+ C2))
)
(setq C (1+ C))
)
(command "._regen") ; <-- I'd like to be able to get rid of this, slow for large drawings
; (sssetfirst nil nil)
(sssetfirst nil LINKEDSET)
)
I'm using "(RFL:GETALLENT ENT)" which returns a set with all the entities linked to ENT. This can be replaced by (ssadd ENT) for testing (not requiring my other routine).
(defun SELECTLINKED (/ C C2 ENT ENTSET LINKEDSET SOURCESET)
(setq SOURCESET (ssget))
(setq LINKEDSET (ssadd))
(setq C 0)
(while (< C (sslength SOURCESET))
(setq ENT (ssname SOURCESET C))
(setq ENTSET (ssadd ENT))
(setq C2 0)
(while (< C2 (sslength ENTSET))
(ssadd (ssname ENTSET C2) LINKEDSET)
(setq C2 (1+ C2))
)
(setq C (1+ C))
)
(command "._regen") ; <-- I'd like to be able to get rid of this, slow for large drawings
; (sssetfirst nil nil)
(sssetfirst nil LINKEDSET)
)
The idea of the command is that you would have an entity selected (or multiple) and you'd be able to right-click on one and have a Shortcut Menu item to execute "(SELECTLINKED) ". "(SELECTLINKED)" would then highlight everything that is linked to the entities you first had highlighted.
Example for use is, say, in my
alignment routines where I draw cross section lines, label alignments or profiles you can select all the linked by running "(SELECTLINKED)" on only one of the entities - there could be thousands of entities.