Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dropping Trailing Zero Even After Using RTOS

4 REPLIES 4
Reply
Message 1 of 5
mgorecki
1215 Views, 4 Replies

Dropping Trailing Zero Even After Using RTOS

Hello, I have code that creates an attribute and block to be used to show a dimension value.

(setq cirDia 0.40) which returns 0.4, but the next command

(command "attdef" "" "CirATT" "" (rtos cirDia 2 2) "ml" "0,0" "1.5" "0")

returns "0.40"

On my computer (and those in the office with me) the attribute will show a default value of "0.40", but there is a computer in another office (offsite) that when the program is run, they get "0.4".  The trailing "0" is dropped.

 

I have tried changing my "DIMZIN" var from 0 to 1, but that has no effect on the attribute dropping the zero.  I just don't know what else that other computer may have set that would affect this variable.

 

Any ideas?

 

Thanks,

Mark

 

4 REPLIES 4
Message 2 of 5
bgingerich
in reply to: mgorecki

This from the Ref. Guide here:

(rtos number [mode [precision]])

 What's happening is the precision specified is 2 decimal places so it's returning 2 places (0.40).  Since you don't want that, if I remember right, just remove the last 2.

...(rtos cirDia 2)...

 (if ("mysolution"=answer) then (click "Accept As Solution"))
------------------------------------------------------------------------------------

─────────────────────────────────────────────────────────────────────────────────────────────
Brandon Gingerich
Message 3 of 5
mgorecki
in reply to: bgingerich

I'm sorry, I guess I wasn't very clear.  I want the 2 place decimal text.  For some reason, the other computer is dropping the trailing "0" that I want to keep.

 

Thanks,

Mark

Message 4 of 5
bgingerich
in reply to: mgorecki

Is the other computer running a vertical product or a different program like Inventor?  See here.

 

(if ("mysolution"=answer) then (click "Accept As Solution"))
------------------------------------------------------------------------------------

─────────────────────────────────────────────────────────────────────────────────────────────
Brandon Gingerich
Message 5 of 5
pbejse
in reply to: mgorecki


@mgorecki wrote:

I'm sorry, I guess I wasn't very clear.  I want the 2 place decimal text.  For some reason, the other computer is dropping the trailing "0" that I want to keep.

 

Thanks,

Mark


Set Dimzin to 0

 

 

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

Post to forums  

Autodesk Design & Make Report

”Boost