ISO 10303-214:2010(E)
NOTE The definition of this function is identical to the definition in ISO 10303-203.
EXPRESS specification:
*) FUNCTION assembly_shape_is_defined (assy: next_assembly_usage_occurrence) : BOOLEAN; LOCAL sdr_set : SET OF shape_definition_representation := []; srr_set : SET OF shape_representation_relationship := []; sdr1_set : SET OF shape_definition_representation := []; pd_set : SET OF property_definition := []; pdr_set : SET OF product_definition_relationship := []; pds_set : SET OF product_definition_shape := []; prop_set : SET OF property_definition := []; END_LOCAL; -- Gather all instances of shape_definition_representation where the -- component part has a representation defined for it. pd_set := bag_to_set( USEDIN(assy.related_product_definition, 'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION.DEFINITION')); pdr_set := QUERY( pdr <* bag_to_set(USEDIN (assy.related_product_definition, 'AUTOMOTIVE_DESIGN.PRODUCT_DEFINITION_RELATIONSHIP.' + 'RELATED_PRODUCT_DEFINITION')) | SIZEOF( USEDIN( pdr, 'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION.DEFINITION')) > 0); IF SIZEOF(pd_set) > 0 THEN REPEAT i:=1 TO HIINDEX(pd_set); sdr_set := sdr_set + QUERY( pdr <* USEDIN(pd_set[i], 'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION_REPRESENTATION.'+ 'DEFINITION') | 'AUTOMOTIVE_DESIGN.SHAPE_DEFINITION_REPRESENTATION' IN TYPEOF(pdr)); END_REPEAT; END_IF; IF SIZEOF(pdr_set) > 0 THEN --mp: first, get all the property_definitions --that reference the elements of pdr_set REPEAT i:=1 TO HIINDEX(pdr_set); prop_set := prop_set + bag_to_set(USEDIN(pdr_set[i], 'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION.DEFINITION')); END_REPEAT; --mp: now, get all the shape_definition_representations -- that are reps of the properties found IF SIZEOF (prop_set) > 0 THEN REPEAT i:=1 TO HIINDEX(prop_set); sdr_set := sdr_set + QUERY( pdr <* USEDIN(prop_set[i], 'AUTOMOTIVE_DESIGN.' + 'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | 'AUTOMOTIVE_DESIGN.SHAPE_DEFINITION_REPRESENTATION' IN TYPEOF(pdr)); END_REPEAT; END_IF; END_IF; -- If there is a representation defined for the component part IF SIZEOF (sdr_set) > 0 THEN -- For each representation of the shape of the component part gather -- all instances of shape_representation_relationship where the -- representation of component part is related to another -- representation. REPEAT i := 1 TO HIINDEX (sdr_set); srr_set := QUERY (rr <* bag_to_set ( USEDIN (sdr_set[i]\ property_definition_representation.used_representation, 'AUTOMOTIVE_DESIGN.REPRESENTATION_RELATIONSHIP.REP_2')) | 'AUTOMOTIVE_DESIGN.SHAPE_REPRESENTATION_RELATIONSHIP' IN TYPEOF (rr)); -- If there is a shape_representation_relationship where the component -- component part's shape_representation is related to another shape_- -- representation. pd_set := bag_to_set(USEDIN(assy.relating_product_definition, 'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION.DEFINITION')); IF SIZEOF(pd_set) > 0 THEN REPEAT i:=1 TO HIINDEX(pd_set); sdr1_set := sdr1_set + QUERY( pdr <* USEDIN(pd_set[i], 'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION_REPRESENTATION.'+ 'DEFINITION') | 'AUTOMOTIVE_DESIGN.SHAPE_DEFINITION_REPRESENTATION' IN TYPEOF(pdr)); END_REPEAT; END_IF; IF ( (SIZEOF(sdr_set) > 0) AND (SIZEOF(sdr1_set) > 0) ) THEN IF SIZEOF (srr_set) > 0 THEN -- For each shape_representation_relationship in that set REPEAT j := 1 TO HIINDEX (srr_set); -- If the other shape_representation in the shape_representa- -- tion_relationship is the shape_representation of the assembly -- product_definition in at least one instance. IF SIZEOF (QUERY (pdr <* bag_to_set (USEDIN (srr_set[j]\representation_relationship.rep_1, 'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION_REPRESENTATION.' + 'USED_REPRESENTATION')) | 'AUTOMOTIVE_DESIGN.SHAPE_DEFINITION_REPRESENTATION' IN TYPEOF (pdr)) * sdr1_set) >= 1 THEN -- If the shape_representation_relationship and the -- product_definition_relationship of each occurrence -- of the component -- and assembly relationship is not given via the -- context_dependent_shape_representation then return FALSE pds_set := QUERY(x <* bag_to_set( USEDIN(assy, 'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION.DEFINITION')) | 'AUTOMOTIVE_DESIGN.PRODUCT_DEFINITION_SHAPE' IN TYPEOF(x)); IF SIZEOF(pds_set) = 0 THEN RETURN (FALSE); END_IF; REPEAT k:=1 TO HIINDEX(pds_set); IF SIZEOF (QUERY (cdsr <* USEDIN (pds_set[k], 'AUTOMOTIVE_DESIGN.' + 'CONTEXT_DEPENDENT_SHAPE_REPRESENTATION.' + 'REPRESENTED_PRODUCT_RELATION') | (cdsr.representation_relation :=: srr_set[j]) )) > 0 THEN RETURN (FALSE); END_IF; END_REPEAT; END_IF; END_REPEAT; END_IF; END_IF; END_REPEAT; END_IF; -- If the shape of the component is not specified or there are no -- violations then return TRUE RETURN (TRUE); END_FUNCTION; -- assembly_shape_is_defined (*
Argument definitions:
assy: The assy identifies the next_assembly_usage_occurrence for which the relationships are to be checked.
NOTE This function realizes the second local rule of default_tolerance_table_cell.
EXPRESS specification:
*) FUNCTION default_tolerance_table_cell_wr2( agg: AGGREGATE OF representation_item): BOOLEAN; BEGIN IF SIZEOF(agg) <= 5 THEN RETURN(TRUE); ELSE RETURN(FALSE); END_IF; END; END_FUNCTION; -- default_tolerance_table_cell_wr2 (*
Argument definitions:
agg: The agg identifies the aggregate of instances which are tested.
NOTE This function realizes the third local rule of default_tolerance_table_cell.
EXPRESS specification:
*) FUNCTION default_tolerance_table_cell_wr3( agg: AGGREGATE OF representation_item): BOOLEAN; BEGIN IF (SIZEOF(QUERY ( i <* agg | (('AUTOMOTIVE_DESIGN.MEASURE_REPRESENTATION_ITEM' IN TYPEOF(i)) AND (i\representation_item.name = 'significant number of digits')) )) = 1) OR ((SIZEOF(QUERY ( i <* agg | (('AUTOMOTIVE_DESIGN.MEASURE_REPRESENTATION_ITEM' IN TYPEOF(i)) AND (i\representation_item.name = 'lower limit')) )) = 1) AND (SIZEOF( QUERY ( i <* agg | (('AUTOMOTIVE_DESIGN.MEASURE_REPRESENTATION_ITEM' IN TYPEOF(i)) AND (i\representation_item.name = 'upper limit')) )) = 1)) THEN RETURN(TRUE); ELSE RETURN(FALSE); END_IF; END; END_FUNCTION; -- default_tolerance_table_cell_wr3 (*
Argument definitions:
agg: The agg identifies the aggregate of instances which are tested.
NOTE This function realizes the forth local rule of default_tolerance_table_cell.
EXPRESS specification:
*) FUNCTION default_tolerance_table_cell_wr4( agg: AGGREGATE OF representation_item): BOOLEAN; BEGIN IF (SIZEOF(QUERY ( i <* agg | (('AUTOMOTIVE_DESIGN.MEASURE_REPRESENTATION_ITEM' IN TYPEOF(i)) AND (i\representation_item.name = 'plus minus tolerance value')) )) = 1) OR ((SIZEOF(QUERY ( i <* agg | (('AUTOMOTIVE_DESIGN.MEASURE_REPRESENTATION_ITEM' IN TYPEOF(i)) AND (i\representation_item.name = 'lower tolerance value')) )) = 1) AND (SIZEOF( QUERY ( i <* agg | (('AUTOMOTIVE_DESIGN.MEASURE_REPRESENTATION_ITEM' IN TYPEOF(i)) AND (i\representation_item.name = 'upper tolerance value')) )) = 1)) THEN RETURN(TRUE); ELSE RETURN(FALSE); END_IF; END; END_FUNCTION; -- default_tolerance_table_cell_wr4 (*
Argument definitions:
agg: The agg identifies the aggregate of instances which are tested.
NOTE This function realizes the fifth local rule of default_tolerance_table_cell.
EXPRESS specification:
*) FUNCTION default_tolerance_table_cell_wr5( agg: AGGREGATE OF representation_item): BOOLEAN; BEGIN IF (SIZEOF(QUERY ( i <* agg | ('AUTOMOTIVE_DESIGN.DESCRIPTIVE_REPRESENTATION_ITEM' IN TYPEOF(i)) )) <= 1) AND (SIZEOF(QUERY ( i <* agg | ('AUTOMOTIVE_DESIGN.DESCRIPTIVE_REPRESENTATION_ITEM' IN TYPEOF(i)) )) = SIZEOF(QUERY ( i <* agg | (('AUTOMOTIVE_DESIGN.DESCRIPTIVE_REPRESENTATION_ITEM' IN TYPEOF(i)) AND (i\representation_item.name = 'cell description'))) )) THEN RETURN(TRUE); ELSE RETURN(FALSE); END_IF; END; END_FUNCTION; -- default_tolerance_table_cell_wr5 (*
Argument definitions:
agg: The agg identifies the aggregate of instances which are tested.
NOTE This is used in the fourth local rule of composite_hole.
EXPRESS specification:
*) FUNCTION get_diameter_for_round_hole ( rh : round_hole ) : REAL; LOCAL sa_set : SET OF shape_aspect; sar_set : SET OF shape_aspect_relationship; pdr_set : SET OF property_definition_representation; ri_set : SET OF representation_item; END_LOCAL; sa_set := get_shape_aspects(rh); REPEAT i:=1 to HIINDEX(sa_set); IF (sa_set[i].description = 'diameter occurrence') THEN sar_set := bag_to_set(USEDIN(sa_set[i],'AUTOMOTIVE_DESIGN.'+ 'SHAPE_ASPECT_RELATIONSHIP.RELATED_SHAPE_ASPECT')); REPEAT j:=1 to HIINDEX(sar_set); IF ((sar_set[j].name = 'diameter') AND (sar_set[j].description = 'profile usage') AND ('AUTOMOTIVE_DESIGN.SHAPE_DEFINING_RELATIONSHIP' IN TYPEOF (sar_set[j])) AND ('AUTOMOTIVE_DESIGN.CIRCULAR_CLOSED_PROFILE' IN TYPEOF (sar_set[j].relating_shape_aspect))) THEN pdr_set := get_shape_aspect_property_definition_representations (sar_set[j].relating_shape_aspect); REPEAT k:=1 to HIINDEX(pdr_set); IF ('AUTOMOTIVE_DESIGN.SHAPE_REPRESENTATION_WITH_PARAMETERS' IN TYPEOF(pdr_set[k].used_representation)) THEN ri_set := pdr_set[k].used_representation.items; REPEAT l:=1 to HIINDEX(ri_set); IF (('AUTOMOTIVE_DESIGN.MEASURE_REPRESENTATION_ITEM' IN TYPEOF(ri_set[l])) AND ('AUTOMOTIVE_DESIGN.LENGTH_MEASURE_WITH_UNIT' IN TYPEOF(ri_set[l]))) THEN RETURN (ri_set[l]\measure_with_unit.value_component); END_IF; END_REPEAT; END_IF; END_REPEAT; END_IF; END_REPEAT; END_IF; END_REPEAT; RETURN(?); END_FUNCTION; (*
Argument definitions:
rh: The rh identifies the instance of round_hole whose diameter is to be determined.
NOTE This function is used to determine the value of the derived attribute language of multi_language_attribute_assignment.
EXPRESS specification:
*) FUNCTION get_multi_language (x : attribute_value_assignment) : label; LOCAL alas : BAG OF attribute_language_assignment := USEDIN(x, 'AUTOMOTIVE_DESIGN.'+ 'ATTRIBUTE_LANGUAGE_ASSIGNMENT.ITEMS'); -- note: sizeof(alas) has to be 1 due to -- multi_language_attribute_assignment.wr2 END_LOCAL; IF SIZEOF(alas) > 0 THEN RETURN(alas[1].language); END_IF; RETURN (?); END_FUNCTION; (*
Argument definitions:
x: The x identifies the instance of attribute_value_assignment for which a language is returned.
NOTE This function is used within the local rules of composite_hole.
EXPRESS specification:
*) FUNCTION get_round_holes_for_composite_hole ( sar_instance_set : SET OF shape_aspect_relationship ) : SET OF round_hole; LOCAL rh_set : SET OF round_hole := []; pdr_set : SET OF property_definition_representation; pdr_set1 : SET OF property_definition_representation; ri_set : SET OF representation_item; END_LOCAL; REPEAT i:=1 to HIINDEX (sar_instance_set); IF ('AUTOMOTIVE_DESIGN.INSTANCED_FEATURE' IN TYPEOF (sar_instance_set[i].related_shape_aspect)) THEN rh_set := rh_set + sar_instance_set[i].related_shape_aspect; END_IF; IF ('AUTOMOTIVE_DESIGN.PLACED_FEATURE' IN TYPEOF (sar_instance_set[i])) THEN pdr_set := get_shape_aspect_property_definition_representations (sar_instance_set[i].related_shape_aspect); REPEAT j:=1 to HIINDEX(pdr_set); IF ((pdr_set[j].used_representation.name = 'feature definition placement') AND ('AUTOMOTIVE_DESIGN.SHAPE_REPRESENTATION' IN TYPEOF (pdr_set[j].used_representation))) THEN ri_set := pdr_set[j].used_representation.items; REPEAT k:=1 to HIINDEX(ri_set); IF (('AUTOMOTIVE_DESIGN.MAPPED_ITEM' IN TYPEOF (ri_set[k])) AND ('AUTOMOTIVE_DESIGN.'+ 'SHAPE_REPRESENTATION_WITH_PARAMETERS' IN TYPEOF(ri_set[k]\mapped_item.mapping_source. mapped_representation))) THEN pdr_set1 := bag_to_set (USEDIN(ri_set[k]\mapped_item.mapping_source.mapped_representation , 'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION_REPRESENTATION.'+ 'USED_REPRESENTATION')); REPEAT l:=1 to HIINDEX(pdr_set1); IF ('AUTOMOTIVE_DESIGN.ROUND_HOLE' IN TYPEOF (pdr_set1[l].definition.definition)) THEN rh_set := rh_set + pdr_set1[l].definition.definition; END_IF; END_REPEAT; END_IF; END_REPEAT; END_IF; END_REPEAT; END_IF; END_REPEAT; RETURN (rh_set); END_FUNCTION; (*
Argument definitions:
sar_instance_set: The sar_instance_set identifies the set of shape_aspect_relationship instances which are tested.
NOTE This function is used in local rules uf different types of shape_aspect.
EXPRESS specification:
*) FUNCTION get_shape_aspect_property_definition_representations ( s_a_instance : shape_aspect ) : SET OF property_definition_representation; LOCAL pd_set : SET OF property_definition := []; pdr_set : SET OF property_definition_representation := []; END_LOCAL; pd_set := bag_to_set (USEDIN (s_a_instance, 'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION.DEFINITION')); IF (SIZEOF (pd_set) < 1 ) THEN RETURN (pdr_set); END_IF; REPEAT i:= 1 to HIINDEX (pd_set); pdr_set := pdr_set + (QUERY( pdr <* USEDIN (pd_set[i], 'AUTOMOTIVE_DESIGN.PROPERTY_DEFINITION_REPRESENTATION.'+ 'DEFINITION') | 'AUTOMOTIVE_DESIGN.SHAPE_DEFINITION_REPRESENTATION' IN TYPEOF(pdr))); END_REPEAT; RETURN (pdr_set); END_FUNCTION; (*
Argument definitions:
s_a_instance: The s_a_instance identifies the shape_aspect which is tested.
EXPRESS specification:
*) FUNCTION item_correlation (items : SET OF GENERIC; c_items: SET OF STRING):LOGICAL; LOCAL c_types : SET OF STRING := []; c_hit : INTEGER := 0; END_LOCAL; REPEAT i:=1 TO HIINDEX(c_items); c_types := c_types + ['AUTOMOTIVE_DESIGN.' + c_items[i]]; END_REPEAT; REPEAT i:=1 TO HIINDEX(items); IF (SIZEOF(c_types * TYPEOF(items[i])) = 1) THEN c_hit := c_hit + 1; END_IF; END_REPEAT; IF (SIZEOF(items) = c_hit) THEN RETURN(TRUE); ELSE RETURN(FALSE); END_IF; END_FUNCTION; (*
Argument definitions:
items: The items identifies the set of instances which are tested, if they are in the set of types constructed from the second argument c_items.
c_items: The c_items identifies a set of STRING, from which a set of types is generated.
The surface_condition_correlation returns function FALSE if, in the case where the name attribute of an instance of property_definition is one of the names associated with the representation of surface conditions, the instance of representation have a different name. If the names are the same, the function returns TRUE. If the name of the property_definition is not in the list of names of surface conditions, the function returns UNKNOWN.
NOTE This function is used in the restrict_representation_for_surface_condition rule.
EXPRESS specification:
*) FUNCTION surface_condition_correlation (pd: property_definition; rep: representation): LOGICAL; CASE pd.name OF 'visual appearance', 'tactile appearance', 'contact ratio', 'hardness', 'treatment result', 'surface texture' : RETURN(pd.name = rep.name); OTHERWISE : RETURN(UNKNOWN); END_CASE; END_FUNCTION; (*
Argument definitions:
pd: The pd identifies the instances of property_definition which are tested.
rep: The rep identifies the instances of representation the pd is compared with.
NOTE This function is used in the second local rule of moments_of_inertia_representation.
EXPRESS specification:
*) FUNCTION value_range_aggregate_rep_item (agg : AGGREGATE OF representation_item) : BOOLEAN; FUNCTION cri (agg : AGGREGATE OF representation_item) : BOOLEAN; BEGIN IF (SIZEOF(agg) = 3) AND (SIZEOF(QUERY(i1 <* agg | ('AUTOMOTIVE_DESIGN.'+ 'MEASURE_REPRESENTATION_ITEM' IN TYPEOF(i1)) )) = 3) THEN RETURN (TRUE); ELSE RETURN (FALSE); END_IF; END; END_FUNCTION; BEGIN IF ((SIZEOF(agg) = 3) AND (SIZEOF(QUERY(i <* agg | ('AUTOMOTIVE_DESIGN.COMPOUND_REPRESENTATION_ITEM' IN TYPEOF(i)) AND cri(i\compound_representation_item.item_element) )) = 1)) THEN RETURN (TRUE); ELSE RETURN (FALSE); END_IF; END; END_FUNCTION; (*
Argument definitions:
agg: The agg identifies the AGGREGATE of representation_items.
NOTE This function realizes the first local rule of value_range.
EXPRESS specification:
*) FUNCTION value_range_wr1( agg: AGGREGATE OF representation_item): BOOLEAN; BEGIN IF (SIZEOF(agg) = 2) AND ((SIZEOF(QUERY ( i1 <* agg | ( 'AUTOMOTIVE_DESIGN.MEASURE_REPRESENTATION_ITEM' IN TYPEOF (i1)) )) = 2) OR (SIZEOF(QUERY ( i2 <* agg | ( 'AUTOMOTIVE_DESIGN.VALUE_REPRESENTATION_ITEM' IN TYPEOF (i2)) )) = 2)) THEN RETURN(TRUE); ELSE RETURN(FALSE); END_IF; END; END_FUNCTION; -- value_range_wr1 (*
Argument definitions:
agg: The agg identifies the AGGREGATE of representation_items which are tested.
NOTE This function realizes the second local rule of value_range.
EXPRESS specification:
*) FUNCTION value_range_wr2( agg: AGGREGATE OF representation_item): BOOLEAN; BEGIN IF (SIZEOF(QUERY ( i <* agg | (i.name = 'upper limit') )) = 1) AND (SIZEOF(QUERY ( i <* agg | (i.name = 'lower limit') )) = 1) THEN RETURN(TRUE); ELSE RETURN(FALSE); END_IF; END; END_FUNCTION; -- value_range_wr2 (*
Argument definitions:
agg: The agg identifies the AGGREGATE of representation_items which are tested.
NOTE This function realizes the third local rule of value_range.
EXPRESS specification:
*) FUNCTION value_range_wr3( agg: AGGREGATE OF representation_item): BOOLEAN; BEGIN IF SIZEOF(QUERY( i1 <* agg | ('AUTOMOTIVE_DESIGN.MEASURE_REPRESENTATION_ITEM' IN TYPEOF (i1)) AND (SIZEOF ( QUERY (i2 <* agg | ('AUTOMOTIVE_DESIGN.MEASURE_REPRESENTATION_ITEM' IN TYPEOF (i2)) AND (i1 :<>: i2) AND (i1\measure_with_unit.unit_component :=: i2\ measure_with_unit.unit_component) ) ) = 1 ))) = 2 THEN RETURN (TRUE); ELSE RETURN (FALSE); END_IF; END; END_FUNCTION; -- value_range_wr3 (*
Argument definitions:
agg: The agg identifies the AGGREGATE of representation_items which are tested.
© ISO 2010 — All rights reserved