Jump to content

Select all blocks


Recommended Posts

Posted

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.

Posted
(sssetfirst nil (ssget "_X" (list '(0 . "INSERT") (cons 410 (getvar 'CTAB)))))

 

Posted

Thank you very much!

The code works, but it also selects arrays. Do you know how to avoid this?

Posted
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.

Posted

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"

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...