Jump to content

SSGET - Greater than or Equal to, but also Less than or equal to


Recommended Posts

Posted

Hey everyone,

 

Was hoping someone could help me out here.

I am trying to write a LISP that will update some old text styles to our newer standards.

The old style were just setup with 1 style and multiple size difference.

 

I am trying to use ssget to create a selection set to select all text or mtext with a range Lets say from 4.25 to 4.75

I think I know how to do this, but I cant seem to figure out the formatting.

 

(ssget "_X" '((0 . *TEXT) (-4 . ">=") (40 . "4.25") (-4 . "<=") (40 . "4.25")))

 

I thought this was correct, but its throwing me an error.

Can anyone help out with this?

I want to get all text 4.25 or higher up to and equal to 4.75.

 

Thanks

Posted

I guess the text height value has to be real or integer and not string.

  • Agree 1
Posted
2 hours ago, Strydaris said:
(ssget "_X" '((0 . *TEXT) (-4 . ">=") (40 . "4.25") (-4 . "<=") (40 . "4.25")))

I think you forgor to put " " in '((0 . "*TEXT") ... and also insted of (40 . "4.25") at the end need to be (40 . "4.75").

image.thumb.png.6c0d938a4c084b43f5598ad6826ba47f.png

Posted
7 minutes ago, Saxlle said:

I think you forgor to put " " in '((0 . "*TEXT") ... and also insted of (40 . "4.25") at the end need to be (40 . "4.75").

image.thumb.png.6c0d938a4c084b43f5598ad6826ba47f.png

HI. 

Yes minor spelling errors as I typed it in quickly. 

Mostly I wasn't sure how to use the (-4. "<=") part of the code to get the results I wanted. 

Thanks for the (cons - 4 "<=") version. Wasn't sure you could do that. This will allow me to use variables. 

 

Cheers. 

Posted
10 hours ago, Strydaris said:

This will allow me to use variables. 

Yes, on this way you can use a variables in "ssget".

 

for e.g. 
(setq txth1 4.25 txth2 4.75
      ss (ssget "_X" (list (cons 0 "*TEXT") (cons -4 ">=") (cons 40 txth1) (cons -4 "<=") (cons 40 txth2)))
      )

 

Posted

@Saxlle & @Lee Mac

 

Thanks.

I got it working and I think I understand more about how to use the operators.

 

Lee, your ssget tutorials was the first place I went when I was trying to figure this out.

I did not know about your quote tutorial though. I will check it out.

 

Thanks again all.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...