Ahmed_Hisham Posted October 31, 2020 Share 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 Link to comment Share on other sites More sharing options...
Jonathan Handojo Posted November 5, 2020 Share Posted November 5, 2020 Um... like this? (defun c:test nil (sssetfirst nil (ssget '((0 . "INSERT") (2 . "cadtutor block 1")))))) Quote Link to comment Share on other sites More sharing options...
Ahmed_Hisham Posted November 5, 2020 Author Share Posted November 5, 2020 Thanks Jonathan that's working fine Quote Link to comment Share on other sites More sharing options...
pkenewell Posted November 5, 2020 Share 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 Link to comment Share on other sites More sharing options...
BIGAL Posted November 5, 2020 Share 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 Link to comment Share on other sites More sharing options...
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.