Selection set – variable

Selection set – variable

Henrik_Lo
Collaborator Collaborator
922 Views
3 Replies
Message 1 of 4

Selection set – variable

Henrik_Lo
Collaborator
Collaborator

Hi

 

Why can I not use bbb in this Selection set
I am looking for a block

 

(setq bbb "A3")
(setq bb (ssget "X" '((2 . bbb))))

 

Regards
Henrik

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

hak_vz
Advisor
Advisor
Accepted solution
(setq bb (ssget "X" (list (cons 2 bbb))))

 

We use quote function or symbol '  to shorten writing where parts of the code are not changed, but at places where variable is used  we must use list command

 

(setq ss (ssget "X"
 (list 
	'(0 . "INSERT")  ;this will not change
	'(62 . 1) ; we look for inserts with red color so this is constant to
	(cons 2 bbb) ; but this changes depending on variable
  )
))

 

Look at this link for further explanation by Lee Mac

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 3 of 4

Henrik_Lo
Collaborator
Collaborator

Hi

 

It is working, yes, thangs for helping me out, thangs.

 

 

Regards

Henrik

0 Likes
Message 4 of 4

hak_vz
Advisor
Advisor

@Henrik_Lo   not your solution but ok,  🙂

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes