Ish Posted November 24, 2020 Share Posted November 24, 2020 Dear team, I need a lisp program to draw horizontal curve of a road in AutoCAD. I will enter radius , curve length, tangent, chord length, angle etc then draw automatically. And if I have already draw horizontal curve I need full report in Excel or notepad. Thanks Quote Link to comment Share on other sites More sharing options...
Jonathan Handojo Posted November 25, 2020 Share Posted November 25, 2020 A rising star with -3 community reputation? Ouch... No wonder you're not getting any response. 1 Quote Link to comment Share on other sites More sharing options...
Ish Posted November 25, 2020 Author Share Posted November 25, 2020 Good people always help 1 Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted November 25, 2020 Share Posted November 25, 2020 (edited) 11 hours ago, Ish said: Good people always help That is a bold statement for someone who seems to only visit this forum to demand free Lisp programs. Edited November 25, 2020 by Roy_043 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 25, 2020 Share Posted November 25, 2020 You mean something like this, have a go at writing something its just the arc properties, (entget (car (entsel "\Pick an arc"))) ((-1 . <Entity name: 82b6b060>) (0 . "ARC") (410 . "Model") (8 . "0") (10 116.242228560598 54.7129767932515 0.0) (40 . 20.0) (50 . 1.30406490850272) (51 . 2.48257365707)) 1 Quote Link to comment Share on other sites More sharing options...
Ish Posted November 26, 2020 Author Share Posted November 26, 2020 (edited) Yes boss: Mainly I need for output report.sir TL - tangent length CL - chord length R - Radius LCC- length of curve E - external distance M - mid ordinate Angle Sir Thanks for your good reply and value of time. This is for output report of curve sir. Edited November 26, 2020 by Ish Quote Link to comment Share on other sites More sharing options...
Jonathan Handojo Posted November 26, 2020 Share Posted November 26, 2020 After everything is entered, where should the curve be inserted? Quote Link to comment Share on other sites More sharing options...
Ish Posted November 26, 2020 Author Share Posted November 26, 2020 (edited) 38 minutes ago, Jonathan Handojo said: After everything is entered, where should the curve be inserted? Mainly I need for output report.sir After I select arc. Sir Edited November 26, 2020 by Ish Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 26, 2020 Share Posted November 26, 2020 Arc length is rad x theta (angle) or get length property. Chord distance pt1 -> pt2 Tangent (setq hyp (/ arcrad (cos (/ angdiff 2.0)))) (setq tang (sqrt (- (* hyp hyp) (* arcrad arcrad)))) Mid know tangent and angles E know 1/2 angle and rad distance -> mid 1 Quote Link to comment Share on other sites More sharing options...
Ish Posted November 26, 2020 Author Share Posted November 26, 2020 10 minutes ago, BIGAL said: Arc length is rad x theta (angle) or get length property. Chord distance pt1 -> pt2 Tangent (setq hyp (/ arcrad (cos (/ angdiff 2.0)))) (setq tang (sqrt (- (* hyp hyp) (* arcrad arcrad)))) Mid know tangent and angles E know 1/2 angle and rad distance -> mid I will be very thanksful to you, Please make a complete lisp sir Thanks u 1 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 26, 2020 Share Posted November 26, 2020 The idea is have a go yourself as you can see I have something it was done back in 1990 . Just start with entsel arc and use VLa-get- the correct property. Command: DUMPIT Select object: ; IAcadArc: AutoCAD Arc Interface ; Property values: ; Application (RO) = #<VLA-OBJECT IAcadApplication 00007ff6f8381e30> ; ArcLength (RO) = 183.377 ; Area (RO) = 4590.91 ; Center = (-27947.5 146195.0 0.0) ; Document (RO) = #<VLA-OBJECT IAcadDocument 000002577e00d318> ; EndAngle = 3.16225 ; EndPoint (RO) = (-28039.0 146193.0 0.0) ; EntityTransparency = "ByLayer" ; Handle (RO) = "71CB7F" ; HasExtensionDictionary (RO) = 0 ; Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 000002577f82e058> ; Layer = "3-PROJ_Área Abrangência PLC" ; Linetype = "CONTINUOUS" ; LinetypeScale = 1.0 ; Lineweight = -1 ; Material = "ByLayer" ; Normal = (0.0 0.0 1.0) ; ObjectID (RO) = 42 ; ObjectName (RO) = "AcDbArc" ; OwnerID (RO) = 43 ; PlotStyleName = "ByLayer" ; Radius = 91.4795 ; StartAngle = 1.15767 ; StartPoint (RO) = (-27910.8 146279.0 0.0) ; Thickness = 0.0 Quote Link to comment Share on other sites More sharing options...
Jonathan Handojo Posted November 26, 2020 Share Posted November 26, 2020 On 11/25/2020 at 7:47 PM, Ish said: Good people always help Lol, I just love how no one is actually offering any help despite this being a ridiculously easy task, haha... Friend... "Good people always think twice before helping". There's a reason no one is helping you. As much as I'm being an annoying pest, this is all you're getting from me. The rest is on your own. (defun c:arcdetails ( / arc) (and (setq arc (car (entsel "\nSelect arc <exit>: "))) ((lambda (x / ep sp) (princ (strcat "\nArc Start Point: " (vl-prin1-to-string (setq sp (vlax-get x 'StartPoint))) "\nArc Mid Point: " (vl-prin1-to-string (vlax-curve-getPointAtParam x (* 0.5 (vlax-curve-getEndParam x)))) "\nArc End Point: " (vl-prin1-to-string (setq ep (vlax-get x 'EndPoint))) "\nArc Radius: " (rtos (vla-get-Radius x) 2) "\nArc Length: " (rtos (vla-get-ArcLength x) 2) "\nChord Length: " (rtos (distance sp ep) 2) ) ) ) (vlax-ename->vla-object arc) ) ) (princ) ) 1 Quote Link to comment Share on other sites More sharing options...
Ish Posted November 26, 2020 Author Share Posted November 26, 2020 Thanks a lot sir Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 27, 2020 Share Posted November 27, 2020 1 suggestion Radius length and chord rtos 2 x where x is number of decimal places. 1 Quote Link to comment Share on other sites More sharing options...
Ish Posted December 1, 2020 Author Share Posted December 1, 2020 On 11/26/2020 at 6:01 PM, Jonathan Handojo said: Lol, I just love how no one is actually offering any help despite this being a ridiculously easy task, haha... Friend... "Good people always think twice before helping". There's a reason no one is helping you. As much as I'm being an annoying pest, this is all you're getting from me. The rest is on your own. (defun c:arcdetails ( / arc) (and (setq arc (car (entsel "\nSelect arc <exit>: "))) ((lambda (x / ep sp) (princ (strcat "\nArc Start Point: " (vl-prin1-to-string (setq sp (vlax-get x 'StartPoint))) "\nArc Mid Point: " (vl-prin1-to-string (vlax-curve-getPointAtParam x (* 0.5 (vlax-curve-getEndParam x)))) "\nArc End Point: " (vl-prin1-to-string (setq ep (vlax-get x 'EndPoint))) "\nArc Radius: " (rtos (vla-get-Radius x) 2) "\nArc Length: " (rtos (vla-get-ArcLength x) 2) "\nChord Length: " (rtos (distance sp ep) 2) ) ) ) (vlax-ename->vla-object arc) ) ) (princ) ) Sir , this working very nice for me. But still TL - tangent length E - external distance M - mid ordinate and Angle . Value is missing, please add these also sir. Thanks Quote Link to comment Share on other sites More sharing options...
Jonathan Handojo Posted December 1, 2020 Share Posted December 1, 2020 18 minutes ago, Ish said: As much as I'm being an annoying pest, this is all you're getting from me. The rest is on your own. Like I said earlier, the above is all you're getting from me. It's not that hard to get those (if you actually know how to code). Why don't you give it a shot first before demanding others for answers? This is a forum where you seek help when you're stuck, not where you seek for free codes specifically for you. All others, if you think I'm wrong by any means, please correct me (or feel free to ban me even... pleasure serving with CADTutor!) 2 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted December 1, 2020 Share Posted December 1, 2020 (edited) Just get your engineering or surveying handbook out and look up horizontal curve you will find a diagram that has all the variables and how to work out the answers, just draw it and think about old school sin cos pythagoras etc. This was like 1 minute on Google Edited December 1, 2020 by BIGAL 1 Quote Link to comment Share on other sites More sharing options...
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.