Skip to main content
6-Contributor
April 24, 2024
Question

Convert a string to integer in Relations and integer / how can i calculate the blank weight of part?

  • April 24, 2024
  • 3 replies
  • 4346 views

Hello,

 

I'm using creo 9.0.8.0 and need a formula to calculate the Blank weight.

 

Usually we write the dimensions down in a parameter like this 10x101x1. I did change it to 6 separate Parameters so that i have 3 for the number and 3 for the decimal places . I multiply the normal numbers in a relation to get the weight and merge the parameters to a single Parameter for the bom.

 

now the problem:

 

some of my colleges say its to complicated and time consuming to fill in those measurements and i need a simplier way of doing it. My new way to do it is by extracting the measurements from a single parameter.

 

The Problem with this solution is that creo cant calculate it that way because it says theyre all Strings and not integers. 

 

Any ideas how to calculate it? Or make it easier? 

PRO_MP_MASS is showing the current weight and not the blank one. And getting the numbers from the first profile isnt an option.

 

If you want i can provide you the current relation/params/part.

 

thanks in adavance

3 replies

24-Ruby III
April 24, 2024

Hi,

MartinHanak_0-1713948879654.png

MartinHanak_1-1713948905784.png

 

PascalE6-ContributorAuthor
6-Contributor
April 24, 2024

Thanks for you answer, but thats the current solution that my coworkers dont like. i need it the other way around. 

 

A problem we have with itos that the decimal is rounded down and up, what isnt a reliable solution for us.

Also we sometimes write mesurements like 10x101.00x20 so that the production sees withe the .00 that the block has to be grinded, what we do not have with itos.

24-Ruby III
April 24, 2024

@PascalE wrote:

Thanks for you answer, but thats the current solution that my coworkers dont like. i need it the other way around. 

 

A problem we have with itos that the decimal is rounded down and up, what isnt a reliable solution for us.

Also we sometimes write mesurements like 10x101.00x20 so that the production sees withe the .00 that the block has to be grinded, what we do not have with itos.


Hi,

in this case the only solution is additional application "attached" to Creo.

  • Creo Toolkit
  • Creo J-Link
  • AutoIT

 

21-Topaz II
April 24, 2024

My understanding of the problem is you want to have a string parameter that specifies the raw blank dimensions in the form:

AAAA X BBBB X CCCC

And to be able to parse that string to obtain the three lengths that are separated by the " X ".

Being able to do this means the people entering the parameter are strictly following whatever rules you set up as to the numbers. Will they only be integer values? Are real (i.e. 25.3) values allowed? These are important things to know in order to attempt the process.

You'll also probably need some way to indicate to someone that there's an error, like if someone doesn't enter anything at all for the source string.

Basically you've got to extract the strings from the original string, then examine them to calculate the equivalent numeric value. Not easy, especially if you're dealing with a wide range of values. You'd have to know what the maximum value someone could use, etc.

Definitely look into the string handling functions available in the Creo relations, so you'll know what "tools" you have to work with.

23-Emerald III
April 29, 2024

Why do any math at all? Creo will give you the weight of your model when you assign a material to the model so it has a density. As for dimensions, those can be extracted from the model.

I don't understand why you need to 1) enter the size values in a string and 2) convert those to real numbers. Are you using your string values to drive the model design?

What is the difference in the current weight and the blank weight? if you are doing a machining operation, then create a blank part that is used to create the finished machined part. These can be related.

PascalE6-ContributorAuthor
6-Contributor
April 29, 2024

We make make big stamping tools, so every prt we create is unique, a tool can easily get up to 500-1000prts if we would make for every prt a block to get the weight it would be to much time we waste just for it. Also our parts are to 99% made in house without a drawing for 95% of them, so its just showing the prt in the BOM.

We need the blank block weight and not the creo provided weight,

The dimension can't be extracted from the part like you say, because we are not only cutting out material from an existing block, were also adding, so it's not a reliable solution.

I need to make it in a string, because some of my collegues complain that it's too complicated with six parameters, before we had a single string, what they want to have back. So i need to convert it to numbers so that the relation is executable and calculates the weight.

As mentioned before, i need the 6 params to realise the ,00 at the end of some measurements.

It would be easy if the bounding box would show the the overall dimensions in a parameter, but thats not the case in creo9.

The string values are only used in the BOM, and if it would work for the weight.