hhhh Posted November 5, 2008 Posted November 5, 2008 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.. Quote
TimSpangler Posted November 5, 2008 Posted November 5, 2008 Anything else?? What have you gotten so far?? Quote
ReMark Posted November 5, 2008 Posted November 5, 2008 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? Quote
Lee Mac Posted November 5, 2008 Posted November 5, 2008 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? Quote
ReMark Posted November 5, 2008 Posted November 5, 2008 ...plz provide at your earliest.. We serve and obey master. Quote
Lee Mac Posted November 5, 2008 Posted November 5, 2008 We serve and obey master. Haha, well said. Quote
ReMark Posted November 5, 2008 Posted November 5, 2008 As you can tell, I have a real problem with the way this guy "asked for a favor." I apologize for my grumpiness. Quote
TimSpangler Posted November 5, 2008 Posted November 5, 2008 Getting right on that request..... *EDIT* Sorry that should have said "demand...." Quote
Lee Mac Posted November 5, 2008 Posted November 5, 2008 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.... Quote
ReMark Posted November 5, 2008 Posted November 5, 2008 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! Quote
jkristia Posted November 5, 2008 Posted November 5, 2008 >>He took an AutoLisp class and these questions are part of his homework Thats what I was thinking too. 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.