integer function in relations?
integer function in relations?
(OP)
Does anyone know if there is an integer function in relations to change a real value to an integer?
I am using a pro/Toolkit program that requires an integer value from a certain dimension on every part. Currently, we must show the dimension, round it, then type in the value. I would much rather automate it! The ceil() function does not change the paramer type.
Thanks, Ron
I am using a pro/Toolkit program that requires an integer value from a certain dimension on every part. Currently, we must show the dimension, round it, then type in the value. I would much rather automate it! The ceil() function does not change the paramer type.
Thanks, Ron





RE: integer function in relations?
floor() and ceil() are your functions you need.
floor(.750) = 0
ceil(.750) = 1
Create a new integer parameter "dummy" and assign it the value calculated with ceil() or floor() function from your dimension:
dummy = floor(d3)
Now "dummy" is an integer and will hold a integer value. Use the variable "dummy" as input for your Pro/Toolkit program.
Good luck!
RE: integer function in relations?
From Hora's example:
floor( .750 ) = 0.000
floor( .750 + .500 ) = 1.000
BML
RE: integer function in relations?
floor( .750 ) = 0.000
but, i would want the answer to be 0
also, if you look at the parameter list, "dummy" is listed as a real number. Then if i deleate the parameter and manualy put it in as an integer, the pro/toolkit program works fine. What I need is some function like (as in fortran):
int(floor( .750 )) = 0
any suggestions?
RE: integer function in relations?
So if d1=2.75, then floor(d1)=2, and itos(floor(d1))=2 but as a string value.
Can this help you out?
Steve
http://www.3dlogix.com
RE: integer function in relations?
RE: integer function in relations?
You are right about the changing type of the variables. When you create an integer parameter in Pro/E this parameter will allow you to introduce only integer values and not something like "floor(.750)". Strange because the result of the "floor(.750)"is an integer value (this is what Pro/E book is saying). Pro/E will allow to introduce only values like 0, 1, 2, etc. The "parameter info" command will show that "dummy" is an integer having value 0. (example)
Let's add in relations the following sentence:
dummy = floor(.750)
Note that the integer variable dummy can keep the result of expresion floor(.750). There is no error message.
But if you have the curiosity to see what happend with the variable dummy, you'll have the surprise to see that the integer "dummy" has been transformed into a float variable and the value assigned is not 0 but 0.00000e+05.
I think there are no solutions to your problem except these:
A. manualy introduce the value asked by Pro/Toolkit application;
B. to change the variable type fron integer to fload in the C/C++ code of your Pro/Toolkit application and re-complile it.
-Hora.
RE: integer function in relations?
<b>thanks!</b>
Ron
RE: integer function in relations?
I'm affraid I cannot recommend you a book for learning Pro/Toolkit because they are not.
But if you know FORTRAN and VB, then you can try yourself to modify the program. You may encounter some problems at compiling stage, but there are solutions to that. Or, if you want, you can send it to me and I will try to make the modification for you. If you agree, I will give you my e-mail address.
-Hora.