Jump to content

Recommended Posts

Posted

please provide me with a program in autolisp for the following?

1.>function to calculate tan(x)?

2.>To draw a rectangle when two diagonal corners are given?

3.>To draw a plate with central hole and start points,width and hole diameter are given.?

plz provide at your earliest..

Posted

Anything else??

 

What have you gotten so far??

Posted

Cheeky little bloke aren't we now?

 

What, we don't all have better things to do?

 

What have YOU done to search out whether or not Lisp routines like this already haven't been written?

Posted

Hi,

 

Just to start:

 

1)

(defun c:tanx (/ ans)
   (initget "Deg Rad")
   (setq ans (getkword "\nInput in Degrees or Radians? [Deg/Rad]: "))
   (setq ang (getreal "Specify Angle: "))
   (if
       (= ans "Deg")
       (setq ang (dtr ang))
   )
   (setq ang2 (/ (sin ang) (cos ang)))
   (alert (rtos ang2))
   (princ)
) ; end tanx
   

(defun dtr (a)
   (* pi (/ a 180.0))
) ; end dtr

2) Just use the inbuilt AutoCAD "rectangle" command...

 

3) Not really sure what you're after, please specify in more detail... i.e. circle with hole? rectangle with hole? width meaning diameter? :huh:

Posted
...plz provide at your earliest..

 

We serve and obey master.

Posted

As you can tell, I have a real problem with the way this guy "asked for a favor." I apologize for my grumpiness.

Posted

Getting right on that request.....

 

 

*EDIT* Sorry that should have said "demand...."

Posted
2.>To draw a rectangle when two diagonal corners are given?

I can't understand why he is asking (*demanding*) for a routine to draw a rectangle when given the points of the vertices of one of the diagonals - the inbuilt AutoCAD function does that anyway.... :glare:

Posted

He took an AutoLisp class and these questions are part of his homework. Now let's see...hmmmm...who gets the 'A' here? Well, it goes to none other than Lee Mac. Congratulations Lee!

Posted

>>He took an AutoLisp class and these questions are part of his homework

Thats what I was thinking too.

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