Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LISP-Solve Tangent length of outer Radius for Parcel creation tool.

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
JBR-1
921 Views, 7 Replies

LISP-Solve Tangent length of outer Radius for Parcel creation tool.

I am having a problem with parcel creation tools in giving me the true tangent length of an outer curve to set my building pads to be within the setbacks at back of lots lines of an outer curve. Here is a modified lisp and hope someone can help. I have not written any lisp in 15 or so years so please any help would be welcome.

 

(defun c:tangentl (/ tan tangentl outer radius ratio)
  (if (and (setq radius (getreal "\nRadius of arc: "))
    (setq tan (getreal "\Length of tangent: "))   
    )
    (progn
      (setq tangentl (/ tan 2.0))   <<<<<<<<-----Here is the start of my problem
      (setq ratio (/ radius (sqrt (- (* radius radius) (* halfchord halfchord) ))))
      (setq outer (* 2 (* ratio halfchord)))
      )
    )
  (princ (strcat "\nOuter tangent Length is " (rtos outer 2 8)))
  (princ)
  )

 

64.png

 

I want to get the min frontage at back of lots to an outer curve so that I can set my pad inside the setback envelope.

 

Thank you.......

7 REPLIES 7
Message 2 of 8
JBR-1
in reply to: JBR-1

Here is the ansewer I need the lisp to solve. Arc Length of 63.65'

64.png

Message 3 of 8
conormccartney3897
in reply to: JBR-1

"halfchord" is not defined, its being treated as a variable.
Message 4 of 8
wfberry
in reply to: JBR-1

The way I see it, your method is only good if the lot lines are radial.  Is this always your case?

 

Bill

 

Message 5 of 8

I think they are only trying to find it when its radial, but more importantly i think the math is off, it looks like its finding the chordal length not the arc segment.
Message 6 of 8
Jeff_M
in reply to: JBR-1

Here's a new lisp to calc this:

 

(defun c:arclenfromoutertan (/ chord halfchord len radius delta)
;;; ASIN Returns the arcsinus of a number in radians
  (defun asin (num)
    (if	(<= -1 num 1)
      (atan num (sqrt (- 1 (expt num 2))))
    )
  )
  (if (and (setq radius (getreal "\nRadius of arc: "))
	   (setq tangent (getreal "\Length of tangent: "))
      )
    (progn
      (setq halftangent (/ tangent 2.0))
      (setq
	ratio (/ radius
		 (sqrt (+ (* radius radius) (* halftangent halftangent)))
	      )
      )
      (setq halfchord (* halftangent ratio))
      (setq delta (* 2 (asin (* (/ 1 radius) halfchord))))
      (setq len (* delta radius))
    )
  )
  (princ (strcat "\nArc length for this outer tangent length is "
		 (rtos len 2 8)
	 )
  )
  (princ)
)

 

Jeff_M, also a frequent Swamper
EESignature
Message 7 of 8
JBR-1
in reply to: wfberry

yes thats where I am having a problem.

 

Thank You for your reply

Message 8 of 8
JBR-1
in reply to: Jeff_M

Jeff
Your are a very good at lisp.
Problem solved thanks to you Jeff

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report