Jump to content

Require lisp to draw horizontal curve in AutoCAD + report


Recommended Posts

Posted

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

Screenshot_20201124-201908.png

Posted

A rising star with -3 community reputation? Ouch... No wonder you're not getting any response.

  • Like 1
Posted (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 by Roy_043
Posted

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

image.png.c7bf2dc71cf5c30042470d102e8f82b0.png

  • Like 1
Posted (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 by Ish
Posted

After everything is entered, where should the curve be inserted?

Posted (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 by Ish
Posted

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

  • Like 1
Posted
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

  • Dislike 1
Posted

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

 

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

 

  • Like 1
Posted

1 suggestion Radius length and chord rtos 2 x where x is number of decimal places. 

  • Thanks 1
Posted
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

 

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

  • Like 2
Posted (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

image.thumb.png.92336bb145d42dd54de781ff4522a1a6.png

Edited by BIGAL
  • Thanks 1

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