Jump to content

Lisp variable to round architectural measurements to nearest foot...


Recommended Posts

Posted

Hello! It's me again! Now that I have my macro figured out, I have a lisp that I am trying to tweak to give me only whole number measurements.

 

My lisp is a continued measurement tool that I use to estimate wire travel distances between devices and adds a user input value for drops. The lisp is set up for (rtos lensom 4 0) which gives me an output in architecural units and precision of whole inches. I know the "0" makes it round to the nearest inch, but I want to round to the nearest whole foot. Is there an extra variable I can include to do this or how should I approach it? Thanks!

Posted

maybe this...

(fix (atoi (rtos (/ lensom 12.0) 2 0)))

Posted

Hmm...I get

 

error: bad argument type: numberp: nil

 

when I add that to my lisp. What does that mean?...

 

Oh, wait a sec. At first it wasn't working, but I looked again and the "lensom" was supposed to be "lensum". Sorry I typed it wrong in my first post. Here is the solution...

 

(rtos (/ lensum 12) 2 0))

 

This works exactly the way I wanted it to. Thanks so much AGAIN lpseifert!

 

***edit***

 

Sorry about the "quote". I couldn't find the "#" to put in my code, but just realized that I have to be the full editor instead of quick reply to do it. Sorry. I am getting the hang of it here.

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