Identifying different object types after using crossing Selection

Identifying different object types after using crossing Selection

Anonymous
Not applicable
820 Views
6 Replies
Message 1 of 7

Identifying different object types after using crossing Selection

Anonymous
Not applicable

Hi,

 

I have used a crossing polygon to select some blocks, text and polylines. I want to manipulate only the text in my selection, but the properties window doesn't offer any selection options. If I use quick select to define a selection using a crossing polygon I can select only the text, but this is quite inconvenient. Does anyone know how to select just text after the crossing polygon selection method?

 

Thanks in advance!

 

Alex 

0 Likes
821 Views
6 Replies
Replies (6)
Message 2 of 7

carl.coghill
Advocate
Advocate

Can you upload the file for us to try?

Carl Coghill
Senior Designer
AutoCAD 2018
Windows 7 Professional 64bit
LinkedIn
0 Likes
Message 3 of 7

Kent1Cooper
Consultant
Consultant

Welcome to these Forums!

 

Try this, when you have a pre-selection highlighted:

 

(sssetfirst nil (ssget "_I" '((0 . "TEXT"))))

 

The "_I" stands for "Implied" selection, what AutoLisp uses to refer to things selected when no command is active.

 

That will leave you with only the Text object(s) among the selection highlighted/gripped, and in the Properties box.

 

If by "text" you mean to include Mtext, you can cover both possibilities with a wildcard:

 

(sssetfirst nil (ssget "_I" '((0 . "*TEXT"))))

Kent Cooper, AIA
0 Likes
Message 4 of 7

ВeekeeCZ
Consultant
Consultant

Couple months ago I tried to demonstrate that using QSELECT is quite fast, see SCREENCAST HERE

0 Likes
Message 5 of 7

RobDraw
Mentor
Mentor

@Anonymous wrote:

I have used a crossing polygon to select some blocks, text and polylines. I want to manipulate only the text in my selection, but the properties window doesn't offer any selection options.


Yes, it does. At the top of the box is a drop down list. You can choose each type of entity in the selection set and make changes without losing your selection set.


Rob

Drafting is a breeze and Revit doesn't always work the way you think it should.
Message 6 of 7

Kent1Cooper
Consultant
Consultant

@RobDraw wrote:

@Anonymous wrote:

.... I want to manipulate only the text in my selection, but the properties window doesn't offer any selection options.


.... At the top of the box is a drop down list. You can choose each type of entity in the selection set and make changes without losing your selection set.


Depending on what you want to do with the things, you may need to be careful doing it that way.

 

Say you want to change the Layer of all Text objects in a pre-selection that includes Text objects but also other kinds of things.  You can have the Properties box limit what it's showing the properties of, with that drop-down list, without un-selecting the remainder of the selection.

 

If you then use the drop-down list for Layer in the Propertiex box, you can change the Layer of the Text objects only, without affecting anything else in the selection.

 

But if you happen to use the Layer drop-down list in the Layer panel in the Ribbon [an easy thing to do by mistake if you're not conscious of the difference], even with the Properties box restricted to showing properties of the Text only, it will still change the Layer of all objects of all types in the selection.  The same can be true for other things you might want to do with the selected objects.

 

The (sssetfirst) approach will let you use either Layer list to change the Layer of the Text objects only, without risk of affecting other things in the selection.  But giving you that option will remove all the other kinds of things from the selection, so you need to choose an approach that suits the particular kind(s) of manipulation(s) you need to make, and the level of awareness of Users.

Kent Cooper, AIA
0 Likes
Message 7 of 7

ВeekeeCZ
Consultant
Consultant

Just little playing with the idea of making selection filtering by entity type little bit faster than with QSELECT. 

Not sure if the following is really faster for single entity type selection or deselection... but it allows selecting more than one type of entity.

Read header of the code. HERE is the tutorial how to use a lisp (code).

HTH

 

;|

FILTER OF CURRENT SELECTION BY ENTITY TYPE

Select or preselect objects any method you want.
Either hit enter for DESELECTION  or  Pick an entity / pick on command line / type into command line of type you want to KEEP. 
You can pick another one, if you want to...

|;

(vl-load-com)

(defun c:XE ( / i ls2 lst pik ss ss2 typ dsl nxt)

  (defun :lst2comma (lst / str)
    (setq str "")
    (foreach e lst
      (setq str (strcat str (substr e 1 1) (strcase (substr e 2) T) " ")))
    (vl-string-trim " " str))

  ;-----------------------------------------------------------------------------------------------------------
  ;-----------------------------------------------------------------------------------------------------------
  
  (if (not (setq ss (ssget "_I")))
    (progn
      (command "_.SELECT")
      (while (> (getvar 'CMDACTIVE) 0)
        (command PAUSE))
      (setq ss (ssget "_I"))))
  (if ss
    (progn
      (repeat (setq i (sslength ss))
        (if (not (member (setq typ (cdr (assoc 0 (entget (ssname ss (setq i (1- i))))))) lst))
          (setq lst (cons typ lst))))
      (setq lst (vl-sort lst '<))
      (while (progn
               (initget (:lst2comma lst))
               (cond ((setq pik (entsel (strcat "\r>> FILTER SELECTION: Select entity [" (vl-string-translate " " "/" (:lst2comma lst)) "] <"(if nxt "done" "DESELECT") ">: "))))
                     (nxt
                      nil)
                     ((setq pik "DESELECT"))))
        (setq pik (if (= 'STR (type pik))
                    (strcase pik)
                    (cdr (assoc 0 (entget (car pik)))))
              ls2 (cond ((= pik "DESELECT")
                         lst)
                        ((not ls2)
                         (if dsl
                           (member pik lst)
                           (list pik)))
                        ((member pik ls2)
                          (if dsl
                            (member pik ls2)
                            (vl-remove pik ls2)))
                        (T
                         (if dsl
                           (progn
                             (princ (strcat "\n" pic ": already not part of current selection."))
                             ls2)
                           (cons pik ls2))))
              ss2 (acet-ss-ssget-filter ss (list (cons 0 (strcase (vl-string-translate " " "," (:lst2comma ls2)))))))
        (sssetfirst nil nil)
        (sssetfirst nil ss2)
        (setq nxt T)
        )))
  (princ (strcat "\nLeft in selection: " (vl-string-translate " " "," (:lst2comma ls2))))
  (princ)
)
0 Likes