Hudson José Broetto Posted July 19, 2023 Posted July 19, 2023 Hello, I need a code to select all blocks in a file. I know I can use Qselect, but I would like a lisp function, to perform this selection with just one command. Quote
Tharwat Posted July 20, 2023 Posted July 20, 2023 (sssetfirst nil (ssget "_X" (list '(0 . "INSERT") (cons 410 (getvar 'CTAB))))) Quote
Hudson José Broetto Posted July 20, 2023 Author Posted July 20, 2023 Thank you very much! The code works, but it also selects arrays. Do you know how to avoid this? Quote
Tharwat Posted July 20, 2023 Posted July 20, 2023 39 minutes ago, Hudson José Broetto said: Thank you very much! The code works, but it also selects arrays. Do you know how to avoid this? You're most welcome. in that case , you need to make a selection set then iterate over each entity ignoring objects that is dynamic blocks. But if you are targeting only blocks with array then the process would be longer via stepping though block definition to check this out and a bit many more steps. Quote
BIGAL Posted July 21, 2023 Posted July 21, 2023 A bit more detail (vla-get-effectivename (vlax-ename->vla-object (car (entsel "Pick obj")))) Pick obj"*U195" An effective name would normally be something that you have named like "WINDOW", but the dynamic block will have a name like "*U23" 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.