Jump to content

New to AutoLISP, quick questions about variables and the SWEEP command


jjatho

Recommended Posts

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Edited by jjatho
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...