|
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; -- get_diameter_for_round_hole |
|
public class FGet_diameter_for_round_hole public static Value run(SdaiContext _context, Value rh) |