Quantcast
Channel: PTC Community : Unanswered Discussions - Modeling
Viewing all articles
Browse latest Browse all 2891

Converting Real Number to Integer

$
0
0

Hello,

 

I use Creo 2.0.

I have dome some internet research and I haven't been able to find how to convert a Real Number-type parameter (like 40.000) into an Integer-type (40) with relations. This is needed for downstream simulation purposes.

I tried the abs(), floor() and ceil() functions. They round to the correct value, but the type is still a real number.

I have tried this instruction as well: Creo String to Integer or Real Number Relation

So what I do is a double conversion: to first convert from Real to string using the itos() function, and then from string to Integer using the above... but what happens is that to output to an Integer, you must first manually create the output parameter before adding the relation (otherwise it defaults to real number), and only works on a known length string. I want to avoid that.

 

There must be some elegant solution around!

 

Any help would be appreciated.

 

Thanks, Alex


Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>