cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Area calcul in familly tables

lzanettin
1-Visitor

Area calcul in familly tables

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


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
ACCEPTED SOLUTION

Accepted Solutions
mbonka
16-Pearl
(To:mbonka)

6 REPLIES 6

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

mbonka
16-Pearl
(To:mbonka)

02.jpg

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

TomD.inPDX
17-Peridot
(To:mbonka)

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.
Announcements
NEW Creo+ Topics: Real-time Collaboration


Top Tags