TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: hudster on January 30, 2008, 07:33:21 AM
-
I'm looking for a way to select xrefs which are only in model space, anyone know of a way to do this?
Cheers in advance for your help.
-
Hi,
To select all xrefs in model space, you can first create a string with all xref names separated with commas to be used in the selection set filter.
(setq str "")
(while (setq blk (tblnext "BLOCK" (not blk)))
(if (cdr (assoc 1 blk))
(setq str (strcat str (cdr (assoc 2 blk)) ","))
)
)
(setq ss (ssget "_X" (list '(0 . "INSERT") '(410 . "Model") (cons 2 str))))
-
Sorry, not trying to purposely make this appear obfuscated but it's what I had time to pen ...
( (lambda ( xrefnames )
(if xrefnames
(ssget "x"
(append
'((0 . "insert")(67 . 1)(-4 . "<or"))
(mapcar
'(lambda ( name ) (cons 2 name))
xrefnames
)
'((-4 . "or>"))
)
)
)
)
( (lambda ( / data result )
(while (setq data (tblnext "block" (null data)))
(if (eq 4 (logand 4 (cdr (assoc 70 data))))
(setq result (cons (cdr (assoc 2 data)) result))
)
)
result
)
)
)