Jump to content

Recommended Posts

Posted

Hey guys,

 

Any ideas on making a custom script or block to calculate pipe deflection given two pipe slopes. We are currently use an excel sheet that works great, but I am curious if I could somehow convert it to work with Civil3D. 

 

I will include snips of the excel sheet we are currently using as reference. 

deflectionexcel1.JPG

deflectionexcel2.JPG

deflectionexcel3.JPG

Posted

Its just a formula converted to a lisp calc.

 

Two common functions are RTD and DTR

;The dtr function converts degrees to radians
;The rtd function converts radians to degrees
(defun dtr (a)
(* pi (/ a 180.0))
)
;
(defun rtd (a)
(/ (* a 180.0) pi)
)
 

These are always handy to have and most experienced coders will have these in an autoload lisp.

 

So your request becomes (setq def (rtd (atan (/  (abs  (- in out)) 100.))))

 

So input, in and out and get a result. Or (setq def (rtd (atan (/  (abs  (- (getreal "\nEnter in value ")(getreal "\nEnter out value " ))) 100.))))

 

 

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