Hi,
I want to have a selection set of both TEXT and MTEXT objects that are in "*/*" format.
(ssget (list '(0 . "TEXT") (cons 1 "*/*")));;;;;<=== just works for text objects
(ssget (list '(0 . "MTEXT") (cons 1 "*/*")));;<=== just works for Mtext objects
so, how can I combine these two in one SSGET command?
To have one selection set for this conditions (Text or Mtext with "*/*" format value)?
Thanks
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
@aqdam1978 wrote:
....
I want to have a selection set of both TEXT and MTEXT objects that are in "*/*" format.
(ssget (list '(0 . "TEXT") (cons 1 "*/*")));;;;;<=== just works for text objects
(ssget (list '(0 . "MTEXT") (cons 1 "*/*")));;<=== just works for Mtext objects
so, how can I combine these two in one SSGET command?
To have one selection set for this conditions (Text or Mtext with "*/*" format value)?
....
You can use a wildcard there, too: '(0 . "*TEXT"). [That will also find any RTEXT entities, if you ever use those.]
And come to think of it, since there are no variables to be evaluated, you should be able to use the shorthand for the (quote) function, without the explicit (list) function, like this:
(ssget '((0 . "*TEXT") (1 . "*/*")))
Hi Kent,
Thank you for your solution 🙂
Can you tell me about RTEXT? I don't know anything about it.
Thanks,
Abbas
@aqdam1978 wrote:
....Can you tell me about RTEXT? I don't know anything about it.
....
I haven't actually used it, so I don't remember why I know about it. It's a way of externally Referencing content of TEXT in a drawing: you create an external text file, and use Rtext to put its text content into a drawing, and if you change that file, it is changed in the Rtext entity in your drawing just as an Xref updates other drawn content. I think you can therefore have, for example, the same text content in Rtext entities in multiple drawings in different ways [different fonts, sizes, etc.], which you wouldn't be able to do with an Xref. You can certainly read about it in Help.
Hi Kent,
Thank you for your help.
I have another question!:
How can we combine another entities to TEXT,MTEXT and RTEXT also? for example attributes:
(0 . "*TEXT") or (0 . "ATTDEF") or (0 . "ATTRIB")
It mean if each of them has "*/*" format in values then ssget should select it.
And is there any "add" function/operator to combines two or more than two selection sets?
something like this: (add ss1 ss2 ss3 ....) <=== ss=ss1+ss2+ss3+....+ssn
Thanks,
Hi,
But I think that SSADD just add one entity to a selection set,
It does not add a SS to another SS!
Thanks,
Abbas
@aqdam1978 wrote:Hi Kent,
Thank you for your help.
I have another question!:
How can we combine another entities to TEXT,MTEXT and RTEXT also? for example attributes:
(0 . "*TEXT") or (0 . "ATTDEF") or (0 . "ATTRIB")
It mean if each of them has "*/*" format in values then ssget should select it.
And is there any "add" function/operator to combines two or more than two selection sets?
something like this: (add ss1 ss2 ss3 ....) <=== ss=ss1+ss2+ss3+....+ssn
Thanks,
Again, I'm not at an AutoCAD computer now, but I believe you can find more than one kind of thing in an (ssget) filter, with comma-separated strings as you can use in (wcmatch):
(ssget '((0 . "*TEXT,ATTDEF") (1 . "*\*")))
However, I believe you can't select Attributes in inserted Blocks this way, but that (ssget) only finds top-level entities.
Try searching the Discussion Group for a way to add selection sets together. What devitg says is correct, that you can't directly add sets together, but you can add one entity at a time, and someone may have made a shortcut routine to do that. If you don't find a better one, try something like this to add ss2 into ss1:
(repeat (sslength ss2)
(ssadd (ssname ss2 0) ss1)
(ssdel (ssname ss2 0) ss2)
)
That changes the content of both ss1 and ss2, so if for some reason you would need them with their original content later, you'd need to make a copy of each to other variable names and combine those.
Hi,
you can use operators "or", "and", "not" etc with dxf code -4 more in example below
(ssget "_X" (list (cons -4 "<OR") (cons 0 "TEXT") (cons 0 "MTEXT") (cons -4 "OR>") (cons 1 "*/*") ) ;_ list ) ;_ ssget
Ales
The best use of logical operator in SSGET , regards when you want to get a scope , like to select all circles between a minimus and maximun radious.