Custom macro - select all text

Custom macro - select all text

Anonymous
Not applicable
3,288 Views
16 Replies
Message 1 of 17

Custom macro - select all text

Anonymous
Not applicable

Is it possible to write a macro that will select all the text objects in a drawing?

 

I know QSELECT will do this rather quickly & easily, but I'm trying to create a one-click button in a toolbar that will do this.

 

Possible? Impossible?

0 Likes
Accepted solutions (1)
3,289 Views
16 Replies
Replies (16)
Message 2 of 17

Shneuph
Collaborator
Collaborator
Accepted solution

Try making a toolbar button command and put this as the macro:

 

(if (= (getvar "cmdactive") 1) (ssget "x" '((0 . "*TEXT*"))) (sssetfirst nil (ssget "x" '((0 . "*TEXT*")))))

 

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
Message 3 of 17

Anonymous
Not applicable

Nice, that did it!

 

Thanks!!

0 Likes
Message 4 of 17

Philip-John
Advocate
Advocate

Currently it selects all texts in the drawing.

Is it possible to work this lisp within a selection?

0 Likes
Message 5 of 17

cadffm
Consultant
Consultant

[F1] ssget

 

Remove the "x"

 

X

Entire database. If you specify the X selection method and do not provide a filter-list, ssget selects all entities in the database, including entities on layers that are off, frozen, and out of the visible screen.

 

 

 

Sebastian

0 Likes
Message 6 of 17

Philip-John
Advocate
Advocate

Thanks 

0 Likes
Message 7 of 17

Sea-Haven
Mentor
Mentor

If you imply the ssget as a variable you can use it directly (setq ss (ssget (list (cons 0 "*Text*))))

 

Like move !ss <enter>

Copy !ss <enter>

 

Note the !

 

Another trick is to make a defun of the ssget then you can use a transparent selection copy 'ss <enter> note the defun is c:ss and transparent is ' not exclamation mark.

 

I think it was over at cadtutor did 4 different filters text pline lines circle etc. can just be used in a normal command 'sst wastext, 'ssl was lines.

0 Likes
Message 8 of 17

Anonymous
Not applicable

I tried to make a macro selecting all the TEXT in continuous but it does not work: / do you know how to help me?

^ C ^ C (sssetfirst nil (ssget "_X" list '(0. "TEXT")' (-4. "! =") '(6. "CONTINUOUS")))

0 Likes
Message 9 of 17

dlanorh
Advisor
Advisor

@Anonymous wrote:

I tried to make a macro selecting all the TEXT in continuous but it does not work: / do you know how to help me?

^ C ^ C (sssetfirst nil (ssget "_X" list '(0. "TEXT")' (-4. "! =") '(6. "CONTINUOUS")))


The highlighted (red) text states NOT equal, try changing to "=" or "&="

I am not one of the robots you're looking for

0 Likes
Message 10 of 17

Anonymous
Not applicable

Even with this change nothing is done

0 Likes
Message 11 of 17

cadffm
Consultant
Consultant

useful or not, take what you asked for

 

^C^C(sssetfirst nil (ssget "_X" '((0 . "TEXT")(6 . "CONTINUOUS"))))

Sebastian

0 Likes
Message 12 of 17

Anonymous
Not applicable

Thank you, I did not understand my mistake.

 

Et si je veux simplement prendre les textes qui ne sont pas en CONTINUOUS ?

0 Likes
Message 13 of 17

dlanorh
Advisor
Advisor

(6. "CONTINUOUS") should be (6 . "CONTINUOUS) space between 6 and "." otherwise it is may not be recognised.

I am not one of the robots you're looking for

0 Likes
Message 14 of 17

cadffm
Consultant
Consultant

@dlanorh you answered to me!? (you replied to my answer), but i already posted the whole working line above.

And 6 . instead 6. ist not the only one mistake.

Spaces between ^ C

Space in front of the first bracket

missing brackets for LIST function

(0. instead (0 .

(6. instead (6 .

(-4. "! =") instead (-4 . "<not")(6 . "Continuous")(-4 . "not>") // or just (6. "~CONTINUOUS")

But he asked for the opposite, so skipped all

 

🤗

 

Sebastian

0 Likes
Message 15 of 17

dlanorh
Advisor
Advisor
Sorry,I'm in a bit of a zombie state at the moment. I really need to get some sleep.

I am not one of the robots you're looking for

0 Likes
Message 16 of 17

cadffm
Consultant
Consultant

😂

😵

😴

👍

Sebastian

0 Likes
Message 17 of 17

Kent1Cooper
Consultant
Consultant

@cadffm wrote:

.... (-4 . "<not")(6 . "Continuous")(-4 . "not>") // or just (6. "~CONTINUOUS")

....


 

Bear in mind that such an approach will also "find" things that are of Continuous linetype simply because their linetype is ByLayer and their Layer's linetype is Continuous.  It will omit  only Continuous-linetype things that are that way because they have Continuous linetype assigned as a property override.

Kent Cooper, AIA
0 Likes