Tharwat Posted June 2, 2010 Posted June 2, 2010 hello everyone, 1- Could anyone tell me the formula of how to get the coordinates of ( C ) point as shown in the attached photo. 2- And the formula of how to get the length of the vertical line also as shown in the attached photo. Note: if formulas are given in Autolisp that would be more appreciated. Many thanks and regards, Tharwat Quote
fuccaro Posted June 2, 2010 Posted June 2, 2010 You forgot to tell us the coords of B. Untested code: (setq b (list 10 20 0)) ; change here: put the real coords (setq r 0.15) ;The radi (setq angle (+ 90 45)) ; in degrees (setq angle (/ (* angle PI) 180.0)) ; in radians (setq c (polar b angle r)) (setq angle (/ (* 45 pi) 180.0)) (setq VertDrop (* r (-1 (cos angle)))) Welcome in the forum! Quote
Tharwat Posted June 2, 2010 Author Posted June 2, 2010 Great thanks to you Mr.Fuccaro, That was fascinating and great favour of you. But for this " (setq VertDrop (* r (-1 (cos angle))))" it is not undertood by visual lisp and Autocad either, which is (-1 (cos angle)) I mean the " -1 " it gives me a reply of mistake. So how can I do instead of ( -1 (cos angle)) My best Regards to you, Tharwat Professional AutoCAD Draftsman Quote
Tharwat Posted June 2, 2010 Author Posted June 2, 2010 (defun c:soft (/ bb r aa ang ang1 c) (prompt "\nThis is to draw an arc 45 degrees ....") (setq bb (getpoint "\nSpecify center point of arc: ")) (setq r (getdist"\nLength of Radius :")) (setq aa (list (car bb) (+ (cadr bb) r))) (setq ang (+ 90 45)) (setq ang1 (/ (* ang PI) 180.0)) (setq c (polar bb ang1 r)) (command "arc" aa "e" c "a" 45) (princ "Thank you Mr.fuccaro for your precious help") (princ) ) This is the complete lisp file now, My Best Regards, Tharwat Quote
fuccaro Posted June 3, 2010 Posted June 3, 2010 (setq VertDrop (* r (-1 (cos angle)))) should be: (setq VertDrop (* r (- 1 (cos angle)))) -There is a space after the minus sign. (princ "glad to help!") Quote
fuccaro Posted June 3, 2010 Posted June 3, 2010 A small observation: try to replace the fourth line of your code: (setq r (getdist"\nLength of Radius :")) With this line: (setq r (getdist"\nLength of Radius :" bb)) Quote
Tharwat Posted June 3, 2010 Author Posted June 3, 2010 Many thanks Mr.fuccaro That was great. And with your reference to the second option ; (setq r (getdist"\nLength of Radius :" bb)) which is " bb " that was also smart it is the same as for example ; (setq pt1(getpoint)) (setq pt2(getcorner pt1)) Thank you so much, Your Sincerely Tharwat Professional AutoCAD Draftsman Quote
BIGAL Posted June 3, 2010 Posted June 3, 2010 If you need more line circle formulas a good starting point is Land Surveying lots of obscure arc-arc line-arc combos. Also check out simple math trig, sin cos tan etc as used above. A simple one that is a pain a double reverse curve know the length and width know 1 radius what is the other ? in Autocad keep filleting till you get close, using formula input corect radius 1st time. Option 2 rad1=rad2 and so on. 4 formulas. Quote
MSasu Posted June 3, 2010 Posted June 3, 2010 A small observation: try to replace the fourth line of your code: (setq r (getdist"\nLength of Radius :"))With this line: (setq r (getdist"\nLength of Radius :" bb)) I think that this should be: (setq r (getdist bb "\nLength of Radius :")) Regards, Quote
Tharwat Posted June 3, 2010 Author Posted June 3, 2010 Thank you Mr.msasu. Your answer is correct beside ours or acutally the one that given by mr fuccaro. So try it and you will find out. Although that your idea is the public one. so thanks for sharing your precious ideas Tharwat Quote
MSasu Posted June 3, 2010 Posted June 3, 2010 Thank you Mr.msasu. Your answer is correct beside ours or acutally the one that given by mr fuccaro. So try it and you will find out. Although that your idea is the public one. so thanks for sharing your precious ideas Tharwat Not sure that understand you - my comment was only about the order of arguments in GETDIST statement call. Regards, Quote
Lee Mac Posted June 3, 2010 Posted June 3, 2010 The order can be either way: (getdist <point> <prompt>) (getdist <prompt> <point>) Both will work. Quote
MSasu Posted June 3, 2010 Posted June 3, 2010 I wasn’t aware of that – just learned something new; thank you! Although is quite unusual for a function call… Regards, Quote
Lee Mac Posted June 3, 2010 Posted June 3, 2010 Yes, I agree it is unusual - I think the getXXX functions were made to be foolproof for those just beginning to learn Quote
fuccaro Posted June 3, 2010 Posted June 3, 2010 I had no AutoCAD when answered to the post so I entered the code directly in the post answer. I missed a space, I am glad to read that the rest it works. 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.