Jump to content

Recommended Posts

Posted

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

Autocad.jpg

Posted

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!

Posted

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

Posted

(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

Posted

(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!")

Posted

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

:)

Posted

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

Posted

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.

Posted
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,

Posted

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

Posted
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,

Posted

The order can be either way:

 

(getdist <point> <prompt>)

(getdist <prompt> <point>)

 

Both will work. :)

Posted

I wasn’t aware of that – just learned something new; thank you! Although is quite unusual for a function call…

 

Regards,

Posted

Yes, I agree it is unusual - I think the getXXX functions were made to be foolproof for those just beginning to learn :P

Posted

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.

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