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
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"))
------------------------------------------------------------------------------------
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
Is the other computer running a vertical product or a different program like Inventor? See here.
(if ("mysolution"=answer) then (click "Accept As Solution"))
------------------------------------------------------------------------------------