The Hurricane Forum
The Hurricane Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Hurricane for AutoCAD
 General Discussion
 Using lisp variable in SSGET expression
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

BKM
Starting Member

2 Posts

Posted - February 26 2008 :  1:29:21 PM  Show Profile  Reply with Quote
I'm looking for help constructing a lisp SSGET statement that uses the value of a variable as part of the expression. I'm relatively inexperienced using lisp and need some direction.

This is the way the statement works normally, having the "TEST" supplied within the quotes:
(setq ss1 (ssget "X" '((0 . "INSERT") (2 . "TEST"))))

I would like to replace the "TEST" with input from a variable value. I've tried it like this:
(setq testval "TEST")
(setq ss1 (ssget "X" '((0 . "INSERT") (2 . testval))))
This doesn't work. Got any sugestions?

Thanks,
Ben

n/a
deleted

112 Posts

Posted - February 26 2008 :  1:50:04 PM  Show Profile  Reply with Quote
Try this:
(setq ss1 (ssget "X" (List(0 . "INSERT") (2 . testval))))
I'm not sure. I'm searching code now, but thought I'd send this and continue to look. Please reply if you find that it works, so I know whether to continue searching.

Steve Bubendorf
Go to Top of Page

n/a
deleted

112 Posts

Posted - February 26 2008 :  1:56:21 PM  Show Profile  Reply with Quote
If the first one didn't work, it looks like I have many examples in the following form that work:

(ssget "x" (list (cons 0 "INSERT") (cons 2 testvalue)))

Steve Bubendorf
Go to Top of Page

BKM
Starting Member

2 Posts

Posted - February 26 2008 :  3:58:07 PM  Show Profile  Reply with Quote
[quote]Originally posted by sbubendorf

If the first one didn't work, it looks like I have many examples in the following form that work:

That worked great. Thank You
Go to Top of Page

n/a
deleted

112 Posts

Posted - February 26 2008 :  4:02:30 PM  Show Profile  Reply with Quote
You're welcome. (Somebody helped me with the exact same question not all that long ago.)

Steve Bubendorf
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Hurricane Forum © 2009 - 2025 Go To Top Of Page
This page was generated in 0.41 seconds. Snitz Forums 2000