Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Round Function

Status
Not open for further replies.

SomeYahoo

Military
Jul 13, 2004
166
0
0
US
Is there no round functionality built in to Pro? We faked it with a ceil(d#-.51), but that seems a bit more cumbersome than round(d#).

Am I missing something here?
 
Replies continue below

Recommended for you

There is no round function.
What are you trying to do with the value?
There may be a better method if we know more about what you are trying to accomplish.
Is the value being used to drive a feature or in a table?


"Wildfires are dangerous, hard to control, and economically catastrophic."
"Fixed in the next release" should replace "Product First" as the PTC slogan.

Ben Loosli
CAD/CAM System Analyst
Ingersoll-Rand
 
We are trying to use a relation to determine the number of instances in a pattern. For it to work correctly, we need to round as opposed to floor or ceiling.
 
The number of occurances for each direction in the pattern should themselves be parametric values. Just use them.


"Wildfires are dangerous, hard to control, and economically catastrophic."
"Fixed in the next release" should replace "Product First" as the PTC slogan.

Ben Loosli
CAD/CAM System Analyst
Ingersoll-Rand
 
I had run into something similar when making a program for ProE. I don't have the program available because it is at a former employer, but I'll tell you what I remember.

I wrote the program to compare both the floor and ceiling values. If the difference between the original value and the floor or ceiling was greater than .5, I would use the other floor/ceiling value. Kind of a round-about way, but should work. Just have to make a few if-then statements.

Hope this helps.
 
Mike's solution sounds like the best way to go about it. The problem with equating the number of pattern instances (pXX) to the real number value is that it always seems to round down.

This could be done with a user program as well. Pro/E's relations editor has a "User Prog" option that lets you link your file to a C program. I've never really been able to make it sing. Anyone had any experience with this? I have a part I made a while back with an attempted link to a simple C program, but I don't think I set Pro/E up for this correctly (there is an include file called "spgusrgl.h" and a few environment variables that had to be set up, and I don't think I did it correctly). Searching through Pro/E's help documentation for "User Prog" tells you about it, but it didn't really help me set it up.

Anyways, if you could make this work, you could write a simple C program to round these values for you.
 
Status
Not open for further replies.
Back
Top