Jump to content

Filter List - Variables


abra-CAD-abra

Recommended Posts

All,

 

I am trying to make the values 25.5 and 26.5 variables, in the filter list example below:

 

(-4 . ">")
(40 . 25.5)
(-4 . "<")
(40 . 26.5)

 

It returns the error: bad SSGET List Value

 

Any ideas?

 

Cheers

Link to comment
Share on other sites

Maybe you missed ""...

 

(-4 . "<AND")
(-4 . ">")
(40 . 25.5)
(-4 . "<")
(40 . 26.5)
(-4 . "AND>")

 

 

Thanks marko_ribar,

 

I got it now - didn't need "AND". It just needed me to wake up!! :lol:

 

(setq s (ssget "_X"
       (list
  (cons 0 "VIEWPORT")
  (cons -4 ">")
  (cons 40 lower)
  (cons -4 "<")
  (cons 40 upper)
       ) ;_ end of list
) ;_ end of ssget
) ;_ end of setq

 

 

All good

Cheers

Link to comment
Share on other sites

For completeness, note that only the expressions which contain variable data need to be quoted, the other expressions can be literals:

(ssget "_X" (list '(0 . "VIEWPORT") '(-4 . ">") (cons 40 lower) '(-4 . "

See here for more information.

Link to comment
Share on other sites

For completeness, note that only the expressions which contain variable data need to be quoted, the other expressions can be literals:
(ssget "_X" (list '(0 . "VIEWPORT") '(-4 . ">") (cons 40 lower) '(-4 . "<") (cons 40 upper)))

See here for more information.

 

 

Thanks Lee,

 

Great tutorial! :thumbsup:

 

#Enlightened

 

Cheers

Link to comment
Share on other sites

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...