LISP seletion set by text style name

LISP seletion set by text style name

Anonymous
Not applicable
903 Views
3 Replies
Message 1 of 4

LISP seletion set by text style name

Anonymous
Not applicable

I am trying to write a lisp in which my selection set is ALL text entities of a specific text style in the dwg; however; I have apparently been unsuccessful in creating the selection set.  I am not receiving a syntax error but rather my selection set never gets created.

Please see below my latest attempt and advise me of where I have gone wrong:

 

(setq st (ssget "_X" '((0 . "TEXT,MTEXT") (1 . "<MY TEXT STYLE NAME>"))))

 

Thanks for your support!

0 Likes
Accepted solutions (1)
904 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

I have discovered that my Group Code number was wrong, so I have changed the "1" to "7" and now the selection set is made.

 

HOWEVER, how may I add to the conditions of this selection set so that the result excludes any of the designated text style that reside on a certain layer, yet retrieves those that reside on all the other layers?

0 Likes
Message 3 of 4

Pointdump
Consultant
Consultant

B,

 

Have you tried QSELECT?

 

Qselect1.png

 

Dave

Dave Stoll
Las Vegas, Nevada

EESignature

64GB DDR4 2400MHz ECC SoDIMM / 1TB SSD
NVIDIA Quadro P5000 16GB
Windows 10 Pro 64 / Civil 3D 2027
0 Likes
Message 4 of 4

Anonymous
Not applicable
Accepted solution

Thanks for the help Dave, but I needed to construct this inside a lisp routine, and to this end I believe I have finally stumbled upon the solution.

 

What I needed the lisp to do was select all the text and mtext of a certain style and the following accomplished this:

(setq st (ssget "_X" '((0 . "TEXT,MTEXT") (7 . "MY TEXT STYLE NAME"))))

 

However, I also needed to exclude from this selectoin all the text and mtext that resided on one specific layer and now the following accomplishes this:

(setq st (ssget "_X" '((0 . "TEXT,MTEXT") (7 . "MY TEXT STYLE NAME") (8 . "~MY SPECIFIC LAYER NAME"))))

 

Note the tilde "~" preceeding MY SPECIFIC LAYER NAME .

This I have learned, tells the program to exclude any of that Group Code (in this case 8 = layer name) from the selection set.

 

I'm not very proficient with lisp but I'm learning.

 

Thanks again,

Barry Navarre

Lafayette, Louisiana