Jump to content

Revsurf multiple option automation


KRBeckman

Recommended Posts

I'm thinking about writing a lisp that was looking for some direction on...

 

If you don't know how creating surfaces in AutoCAD (in this case Revsurf's) depending on which end of the profile curve you are closest to when you select it determines which direction the face normal will be. And since the company I work for uses only 1-sided faces for rendering this gets to be a pain in the butt.

 

Also depending on which end of the object that defines the axis of rotation determines which direction the surface is created (clockwise or counterclockwise)

 

So basically using the same two entities you can get 4 similar, but completely different in my case, surfaces. I assume there has to be some sort of logic behind which ends you pick and what the result is, but I've spent quite a bit of time trying to figure it out and I can't.

 

So what I'm thinkink is create a lisp that will prompt me to select both objects, then the lisp will try one possible input (top of profile & top of axis), then prompt for a yes or no whether it worked. If yes end the program, if no continue to the next option, etc.

 

But in order to do this I need to be able to tell the lisp WHERE to select the two entities, not just which entities. My first question would be is this possible? And if so how?

 

Any help would be greatly appriciated.

Link to comment
Share on other sites

But in order to do this I need to be able to tell the lisp WHERE to select the two entities, not just which entities. My first question would be is this possible? And if so how?

 

Entsel returns two items

( )

 

To call on certain commands, such as trim or revsuf, you can specify the pick by creating you own list

 

 

Maybe the folowing could give you a stating point at least. No error trapping

 

(defun c:test ()
(vl-load-com)

(setq sourceObject (entsel "\nSelect object to revolve: :"))
(setq revolutionAxis (entsel "\nSelect axis: :"))

(setq ename (car revolutionAxis))

(initget "Start End")
(setq Mode (getkword "\n[start/End]"))


(cond

 ((= Mode "Start")(setq revEntsel (list ename (vlax-curve-getStartPoint ename))))
 ((= Mode "End")  (setq revEntsel (list ename (vlax-curve-getEndPoint ename)))))


(command "revsurf" sourceObject revEntsel 0 30)

)

Link to comment
Share on other sites

Ok, I get where you're going... I'll give this a try. Thanks a ton. I do have one question... if the revolution axis intersects with another object at its endpoint, could there be an issue with autodad selecting the wrong object at that point?

Link to comment
Share on other sites

Ok, I get where you're going... I'll give this a try. Thanks a ton

Your welcome

 

if the revolution axis intersects with another object at its endpoint, could there be an issue with autodad selecting the wrong object at that point?

 

I don't think there should be an issue. By supplying the Revsurf command picks using ( ) the objects should be selected correctly

 

Mabye test it for a few different scenarios just to be sure

 

The only things to watch out for may be OSNAPS. Also the direction of which the curves are drawn (For determaining the start/end points)

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...