3 Filter selection Text Objects

3 Filter selection Text Objects

k005
Advisor Advisor
791 Views
5 Replies
Message 1 of 6

3 Filter selection Text Objects

k005
Advisor
Advisor

 

Hello friends;


How can I select the L=196 text object with a filter when I click it?

There should be 3 filters.

 

1- Color
2- content ( L=196)
3- Text height

 

Thanks.

0 Likes
Accepted solutions (1)
792 Views
5 Replies
Replies (5)
Message 2 of 6

hak_vz
Advisor
Advisor
(setq ss (ssget '((0 . "TEXT") (1 . "L=196") (62 . 1) (40 . 5))))

 

This will create selection set of selected text with content L = 196, color red and height 5 units

Change color according to index color numbers.

 

To select all similar text use selection mode string "X"

(setq ss (ssget "X" '((0 . "TEXT") (1 . "L=196") (62 . 1) (40 . 5))))

 

To use in command line let say erase:

Command: ERASE
Select objects: !ss
<Selection set: 43>
2 found

 

 

 

 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Message 3 of 6

k005
Advisor
Advisor

 

@hak_vz 

 

It will perform this operation automatically when I select the text object and confirm it. ie parameters-filters will be selected by itself.

"2nd". condition is not always fixed...

0 Likes
Message 4 of 6

pbejse
Mentor
Mentor
Accepted solution

@k005 wrote:

How can I select the L=196 text object with a filter when I click it?

1- Color 2- content ( L=196) 3- Text height

(defun c:demo (/ source ent data ss)
  (and
    (setq source (car (entsel "\nSelect Text source: ")))
    (eq (cdr (assoc 0 (setq ent (entget source)))) "TEXT")
    (setq data (mapcar '(lambda	(d)
			  (assoc d ent)
			)
		       '(62 0 1 40)
	       )
    )
    (sssetfirst
      nil
      (ssget "_X"
	     (if (car data)
	       data
	       (cons '(62 . 256) (Cdr data))
	     )
      )
    )
  )
)

HTH

Message 5 of 6

k005
Advisor
Advisor

@pbejse 

 

Thank you my friend. It's ok. 🤗

0 Likes
Message 6 of 6

ronjonp
Advisor
Advisor

Here's my version 🤓

ronjonp_0-1626968160298.png