cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

How can you calculate with time functions in Isodraw macros?

TimSharp
6-Contributor

How can you calculate with time functions in Isodraw macros?

I'm trying to work out the number of seconds it takes for a macro to run.

I set two variables - time_start = ticks()

time_end = ticks()

To work out the total time in seconds I want to take away time_start from time_end (and divide by 60) but it gives an error.

Is this because they are strings?

If so, can they be converted to floats for the calculation? In a previous life, the ME10 macro language had a "val" function that would convert a string to a value (float I presume). Is there a way round it in IML?

1 REPLY 1
TimSharp
6-Contributor
(To:TimSharp)

I've answered my own question (I won't collect the points!)

If I declare the variables (including the result variable) as floats rather than strings, it seems to do the working out.

Top Tags