
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am using the code below to select by dynamic block name. It specifies one dynamic block name. I would like to specify a bunch. I am not a lisp expert and I have tried this a number of ways. Is it possible to use or this way? Or should I use a loop with a counter?
(defun c:sb (/ e name n out ss)
(vl-load-com)
(if (setq name "Place Your Dynamic Block Name";;;Use this Without User input
;name (getstring T "\nEnter Block name: ");;;Use this With User input
ss (ssget "_X" '((0 . "INSERT")))
n -1
out (ssadd)
)
(while (setq e (ssname ss (setq n (1+ n))))
(if (= :vlax-true (vla-get-IsDynamicBlock (vlax-ename->vla-object e)))
(if (= (strcase (vla-get-Effectivename (vlax-ename->vla-object e))) (strcase name))
(ssadd e out)
)
)
)
)
(if (/= 0 (sslength out))(sssetfirst nil out)(princ (strcat "No Dynamic Block found by the Name - " name)))
(princ)
)
Solved! Go to Solution.