Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hello,
I need help to have the area of all instances in familly tables.
What is your method?
I have a parameter called SURFACE
And a relation : SURFACE=MP_SURF_AREA
but in the familly table, after adding the parameter SURFACE, and verifying all instances,
the aera is the same of the generic part.
My instance have different dimensions so I need each area for each instances.
Anyone have a solution?
Thanks
Laurent
Solved! Go to Solution.
Hello,
put your relation for AREA calculating in POST REGENERATION relations. (see attached picture). In my opinion it means that ProE will do following:
- regenerate model (change of size)
- calculate relations
Thank you,
it works fine,
In my family table, is it possible to put a "-" instead of the area for some instance?
we need the area only for gold plated instance.
Laurent
Yes, but it is complicated. You need a text type parameter to hold a "-" and a way to determine if the item is gold plated.
To put the text representation of a real value into a text type you need to convert the calculated area into a text type parameter. There hasn't been a function that converts real numbers to strings, but you can make one that is close.
I'm certain someone has posted it here already, but will look.
This is a conversion from a real number, area_real to a string area_string. If the item is plated, as indicated by the parameter plated_boolean, it sets the value to "-"
/*itos(int) Converts integers to strings. Here, int can be a number or an expression. Nonintegers are rounded off.
/*extract(string, position, length) Extracts pieces of strings.
/*string_length(parameter name) returns the length in characters of the string contained by parameter name
/* Create the following parameters of the type shown in the suffix. Only the fill_in_zeros_string is given an initial value
/* area_real will be set to whatever measurement result area is obtained from.
/* Parameter area_real
/* Parameter area_fraction_real
/* Parameter area_string
/* Parameter area_whole_string
/* Parameter area_fraction_string
/* Parameter decimal_places_integer
/* Parameter fill_in_zeros_string ="0000000000000000"
/* Parameter plated_boolean
/* Relations to convert real to string with given number of decimal places.
/* this is to prevent rounding of the area if itos was used directly
area_whole_string= itos(floor(area_real))
area_fraction_real = area_real - floor(area_real)
area_fraction_string = itos(area_fraction_real*10^decimal_places)
/* This replaces leading zeros; .0001 * 10000 = 1; needs to be 0001
if string_length(area_fraction_string) < decimal_places_integer
area_fraction_string = extract(fill_in_zeros_string, 1, decimal_places_integer-string_length(area_fraction_string) ) + area_fraction_string
endif
area_string = area_whole_string + "." + area_fraction_string
if plated_boolean <> True
area_string = "-"
endif
Never noticed that button. Great tip, Milan!
From the help files...
3. If you specified any relations as Post Regeneration, the system solves these relations after the regeneration is complete.