jjatho 发表于 2022-7-6 07:25:13

New to AutoLISP, quick questio

I'm brand new to AutoLISP, but I do have programming experience so I've been able to sort out a few things. I'm having problems with the following though.
 
I prompt the user for some input to store in variables, which seems to work fine, but I'm not sure how to use those variables later in the Command function.
 

(setq eyeLength(getreal "\n Eye Length (in): "))(command "CIRCLE" "0,0" ""eyeWidth"")
 
I'd like the value for eyeWidth to be used as the radius, but I can't seem to get the right syntax for it to work. None of the examples I've found online actually use variables in commands, so I'm a bit stuck.
 
The second question is a bit more advanced. Once I draw all the lines, arcs, and circles I need, I have to sweep the circles across the arcs and lines. I'm not really sure where to begin. How does one even go about selecting an object with AutoLISP? I need to figure this out so I can SWEEP and EXTRUDE a few things.
 
Thanks!

ketxu 发表于 2022-7-6 08:05:23

1.
(command "CIRCLE" "0,0" eyeLength)
 
2.Some of funtion will helpful :
- entsel: prompt user for piking an object ( nentsel, nentselp is sth #)
 
- ssget : prompt user for selecting objects
 
- entlast : select object (ename) created last
 
And sth more
You should go to help develop

jjatho 发表于 2022-7-6 08:40:02

Thanks. That worked for the first question.
 
I guess a follow up would be, can I select objects with their entity name? I figure I can just check the entity name with entlast and entget every time I create an object and then just assign that to a variable and use it to select them later on.
 
EDIT: Ok I've figured it out, apparently I can just use the variable with the entity name directly in commands. This is going to save me immense amounts of time.
页: [1]
查看完整版本: New to AutoLISP, quick questio