News:

Please note new Forum URL: forum.designcad.com

Main Menu
DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

PRECISION?

Started by SFA, August 31, 2013, 09:54:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SFA

How do I find out what the current PRECISION is in order to set it back when I end my MACRO?


SEMPER IN EXCRETIA

Bob P

Designcad makes all of its floating-point calculations in double precision, all the time.  All BasicCad statements having to do with precision have to do with what is displayed, either on the screen, in dimensions, (Sys() functions) or in dialog boxes (Precision statement). 

I've thrown all my macro notes and help files into a single zip file here.

SFA

Bob, Thank you.  These are very useful.

My problem is probably old age/myopia as I cannot find the Sys function or whatever it is tells us what the current display precision is for numbers expressed as strings.  I can set it by using the PRECISION command but I cannot query it. HELP!

SFA

SEMPER IN EXCRETIA

samdavo

Thanks Bob.

SFA - gotta feeling that precision varies - whether dimensions ( linear, angle etc all different)  or Units (U hotkey) - or coordinate bar for that matter.  And hence my guess is that you may have to be more specific.

dcadRob

I don't see it the help files but it's easy to derive - put a number into a string and count the number of decimal places.
'test precision
test$=1
currentpvalue=len(test$)-2
if currentpvalue<0 then currentpvalue=0
print test$,currentpvalue
anykey



SFA

Rob, Thank you.

THAT IS WHY YOU ARE A HERO and I am a Newbie.
SEMPER IN EXCRETIA