bad SSGET error list

bad SSGET error list

diogo-braz
Explorer Explorer
819 Views
7 Replies
Message 1 of 8

bad SSGET error list

diogo-braz
Explorer
Explorer

This line of code works fine in BricsCAD, but when I try to run it in AutoCAD, it doesn't work. Someone can help why I'm having this problem?

 

(setq lista (ssget (list (cons -4. "<or") (cons 0. "TEXT") (cons 0. "MTEXT") (cons -4. "or>"))))

 

"; error: bad SSGET list"

0 Likes
Accepted solutions (1)
820 Views
7 Replies
Replies (7)
Message 2 of 8

J-Rocks
Collaborator
Collaborator
Accepted solution

Remove the point like this:

(cons -4 "<or") (cons 0 "TEXT") (cons 0 "MTEXT") (cons -4 "or>")

Although this is enough:

(ssget '((0 . "TEXT,MTEXT")))

Message 3 of 8

johnyDFFXO
Advocate
Advocate

@diogo-braz wrote:

This line of code works fine in BricsCAD, but when I try to run it in AutoCAD, it doesn't work. Someone can help why I'm having this problem?

 

(setq lista (ssget (list (cons -4. "<or") (cons 0. "TEXT") (cons 0. "MTEXT") (cons -4. "or>"))))

 

"; error: bad SSGET list"


 

It needs integers, not reals. Remove dots from all code numbers -4. / 0.

Message 4 of 8

diogo-braz
Explorer
Explorer

Thank you, it worked fine

0 Likes
Message 5 of 8

johnyDFFXO
Advocate
Advocate

Ohh, I see where the point is coming from... 

 

it's (cons 0 "TEXT") vs '(0 . "TEXT") 

 

In the case of quoted dotted pair is the point necessary but must be separated by spaces from both sides.

0 Likes
Message 6 of 8

DannyNL
Advisor
Advisor

@J-Rocks wrote:

Remove the point like this:

(cons -4 "<or") (cons 0 "TEXT") (cons 0 "MTEXT") (cons -4 "or>")

Although this is enough:

(ssget '((0 . "TEXT,MTEXT")))


It's even possible to use a wildcard 😀

 

(ssget '((0 . "*TEXT")))

0 Likes
Message 7 of 8

J-Rocks
Collaborator
Collaborator

Be mindful of RTEXT. 😂

0 Likes
Message 8 of 8

DannyNL
Advisor
Advisor

You are right about RTEXT, but in the 30+ years I've been working with AutoCAD I've maybe seen it once. Which doesn't mean it isn't used (n=1) and there might be some use for it.

 

IMO, if you use RTEXT, it should only be used to 'import' text files and then explode it to MTEXT asap.
Otherwise you will have additional reference files to send to your clients, which can easily be forgotten leaving the client without all the information 😁

0 Likes