Strydaris Posted June 12 Posted June 12 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 Quote
Tharwat Posted June 12 Posted June 12 I guess the text height value has to be real or integer and not string. 1 Quote
Saxlle Posted June 12 Posted June 12 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"). Quote
Strydaris Posted June 12 Author Posted June 12 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"). 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. Quote
Saxlle Posted June 13 Posted June 13 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))) ) Quote
Lee Mac Posted June 13 Posted June 13 You can use both evaluated expressions and quoted literals in a list, e.g.: (setq ht1 4.25 ht2 4.75 sel (ssget "_X" (list '(0 . "*TEXT") '(-4 . ">=") (cons 40 ht1) '(-4 . "<=") (cons 40 ht2))) ) You might find the following tutorials useful in this regard - https://lee-mac.com/quote.html https://lee-mac.com/ssget.html 1 Quote
Strydaris Posted June 13 Author Posted June 13 @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. Quote
Recommended Posts
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.