Ahmed_Hisham Posted October 31, 2020 Posted October 31, 2020 Hi all, I want to select specific block by knowing its name lets say block name "cadtutor block 1" by using (vl-catch-all-apply) method Thanks Quote
Jonathan Handojo Posted November 5, 2020 Posted November 5, 2020 Um... like this? (defun c:test nil (sssetfirst nil (ssget '((0 . "INSERT") (2 . "cadtutor block 1")))))) Quote
Ahmed_Hisham Posted November 5, 2020 Author Posted November 5, 2020 Thanks Jonathan that's working fine Quote
pkenewell Posted November 5, 2020 Posted November 5, 2020 (edited) FWIW - Perhaps a little more complete routine for an example: Just remove the "X" from the ssget statement if you want to select items instead of searching the whole drawing. (defun c:TEST () (if (/= (setq nam (getstring T "\nEnter Name of Block: ")) "") (if (setq ss (ssget "X" (list (cons 0 "INSERT")(cons 2 nam)))) (progn (sssetfirst nil ss) (Princ (strcat "\nFound " (itoa (sslength ss)) " Block(s) named \"" nam "\" inserted in this drawing. ")) ) (princ (strcat "\n No Block name \"" nam "\" found. ")) ) (princ "\nNo Block Name Entered ") ) (princ) ) Edited November 5, 2020 by pkenewell Quote
BIGAL Posted November 5, 2020 Posted November 5, 2020 If you want just Model space (setq ss (ssget "X" (list (cons 0 "INSERT")(cons 2 nam)(cons 410 "Model")))) current layout (setq ss (ssget "X" (list (cons 0 "INSERT")(cons 2 nam)(cons 410 (getvar 'ctab))))) 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.