Check this out check supplied as is with no warranty of its accuracy, draw a circle at true size or a pline shape with a top horizontal surface, does not need to be closed. Note this for metric shapes
Code:
; channel flow based on mannings value and a horizontal pline
(defun mannpipe ( / vlent ent objlen objarea vel r slope Qcap)
(princ "this is in lisp")
(vl-load-com)
(setq ent (entsel "\npick pline or circle"))
(setq vlent (vlax-ename->vla-object (car ent)))
;; check to see if the object selected is a polyline or circle
(if (= (vla-get-objectname vlent) "AcDbPolyline")
(PROGN
(setq objLEN (vla-get-LENGTH vlent))
(setq objAREA (vla-get-AREA vlent))
)
)
(if (= (vla-get-objectname vlent) "AcDbCircle")
(PROGN
(setq RAD (vla-get-Radius vlent))
(setq objarea (vla-get-area vlent))
(setq objlen (vla-get-Circumference vlent))
)
)
(setq R (/ objarea objlen))
(setq mannings (getreal "\nEnter mannings value"))
(setq slope (getreal "\nEnter slope in % "))
(setq p1 (/ 2.0 3.0))
(setq vel (/ (* (expt r p1) (sqrt (/ slope 100.0))) mannings )) ;mannings formula
(setq Qcap (* 1000.0 (* Vel objarea))) ; lt/s
(if (= Qcap nil)
(princ "\nSelect again not a pline or Circle")
)
(PRINC (strcat "\Flow " (rtos Qcap 2 0) " l/s Velocity " (rtos Vel 2 2) " m/s"))
)
; end of defun
(mannpipe)
(princ)