Keep only "Blocks" in current selection.
Hi all, and thanks for reading in advance
Short: When I have a selection with all kinds of objects (Blocks, lines, dimensions, etc…).
I'ld like a command that keeps only the blocks in my selection.
Long: I need to do this so the attributes of my blocks become visible. So I can fill in values.
In Autocad I had a working lisp for this (see attached).
Or with autocad's "Quick Select" this was also possible.
Comments
-
Hello.
From my testing, the script works fine in Bricscad.
Alternatively, you could work with Quick Select like this:
- Activate Properties panel.
- Create a selection.
- In Properties panel click the button "Swithch between Quick Select and Properties".
- From the drop-down choose "Block Reference".
- In the toolbar below, click "Add to new selection set", it is the rightmost button.
At this stage, only the blocks in the original selection are still selected.
1 -
The custom command in the attached file will de-select everything in a selection set except for any block insertions in the set.
If you remove all the leading semi-colons from the code, it will also give you the option to de-select everything except insertions of one particular block — but only if that block's name has no spaces in it. You'd have to type the name of the block, or else hit Enter to opt out of selecting a particular block. So it would not be as useful for what you want to do. If you leave in the leading semi-colons, or delete all the lines with leading semi-colons, it'll just quietly de-select everything but block insertions.
0 -
Hello WesFr,
(defun C:XCLUDE (/ sset ) ; = Selected Blocks Only
(if (setq sset (ssget "_I" '((0 . "INSERT")))) ; there are preselected objects [= Implied selection]
(sssetfirst nil sset ); select/grip/highlight only Blocks among them
; Will also include "INSERT" object types other than Block references, such as XREF, MINSERT, WMF
)
)0 -
Check out lee-mac.com SSGET functions has some real helpful filters you can use. Don't forget can have multiple filters.
(setq sset (ssget '((0 . "INSERT")(cons 8 layname)(cons 410 (getvar 'ctab)))))
Not to mention Not And Or etc.
0