TudorN Posted May 12, 2021 Posted May 12, 2021 Hello everyone! So, i am doing a school project in which i want to select all circles of a given radius and then move them all in the arithmetic mean of all centers. The arithmetic mean is no problem, everything works fine, till i add the "more complex" filter. Here is the part of the code: (initget 7) (setq radius (getint "\nEnter radius: ")) (setq ss (ssget "X" '((0 . "CIRCLE") (-4 . "=") (40 . radius)))) The thing is, when i swap (40 . radius) with, lets say, (40 . 10)... it works for all circles with the radius equal to 10. But i want to give the radius by keyboard. And i get the error from the title. Also... if i put a (princ radius) before the filter, it shows me the value of radius. Quote
Lee Mac Posted May 12, 2021 Posted May 12, 2021 The issue is your use of the apostrophe to quote the ssget filter list as a literal list, resulting in the radius variable being intrepreted as a symbol rather than being evaluated to yield the value that the variable has been assigned. I would strongly suggest reading my tutorial on The Apostrophe and the Quote Function to understand why this issue arises, and how to solve it. 2 Quote
TudorN Posted May 12, 2021 Author Posted May 12, 2021 @Lee Mac Thank you! The tutorial really helped, I figured it out and now I understand . Quote
Lee Mac Posted May 15, 2021 Posted May 15, 2021 On 5/12/2021 at 7:10 PM, TudorN said: @Lee Mac Thank you! The tutorial really helped, I figured it out and now I understand . Excellent - I'm glad to hear it! You're most welcome 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.