SSGET Function

SSGET Function

Anonymous
Not applicable
503 Views
2 Replies
Message 1 of 3

SSGET Function

Anonymous
Not applicable

Hello all,  I couldn't see what the  problem with the following line of code is, I wanted to erase text objects in a certain area using the ssget function with a fence. the x coordinates of the fence are 6.18347 and 9.36639 but the y coordinate of the fence varies, so i used a variable 'Y_DIFF' with an int value which would be an input by the user.But when I try the code it says "error: too many arguments"
Here is the code

 

(setq eraseTxt (ssget "_F" '((LIST 6.18347 (- 1.14754 Y-DIFF)) (LIST 9.36639 (- 1.14754 Y-DIFF))) '((0 . "TEXT"))))

 

Thanks in advance for your help

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

Kent1Cooper
Consultant
Consultant
Accepted solution

@Anonymous wrote:

.... 

(setq eraseTxt (ssget "_F" '((LIST 6.18347 (- 1.14754 Y-DIFF)) (LIST 9.36639 (- 1.14754 Y-DIFF))) '((0 . "TEXT"))))

 

....

You can't start a list with an apostrophe [= (quote) function] unless there's nothing inside it that requires evaluation, but it can all be read "literally."  Your Y-DIFF variable is something that it needs to evaluate.  Try:

 

(setq eraseTxt (ssget "_F" (list (LIST 6.18347 (- 1.14754 Y-DIFF)) (LIST 9.36639 (- 1.14754 Y-DIFF))) '((0 . "TEXT"))))

 

Kent Cooper, AIA
0 Likes
Message 3 of 3

Anonymous
Not applicable

Thanks Kent it worked great!

0 Likes