FUNCTION valid_selected_instance_representation

(* SCHEMA step_merged_ap_schema; *)
-- IN AP203e2/AP238 STEP-NC/AP242
FUNCTION valid_selected_instance_representation
      (pd : product_definition_or_assembly_relationship ) : LOGICAL;
   LOCAL
      properties : SET OF property_definition := bag_to_set(QUERY (prd <* USEDIN(pd, 'STEP_MERGED_AP_SCHEMA.PROPERTY_DEFINITION.DEFINITION')| prd.name = 'occurrence selection'));
      property_definition_representations : SET OF property_definition_representation := bag_to_set(QUERY (pdr <* USEDIN(properties[1], 'STEP_MERGED_AP_SCHEMA.PROPERTY_DEFINITION_REPRESENTATION.DEFINITION')| pdr.used_representation.name = 'selection criteria'));
      selected_representation : representation;
   END_LOCAL;
      IF SIZEOF(properties) <> 1 THEN
         RETURN (FALSE);
      END_IF;
      IF SIZEOF(property_definition_representations) <> 1 THEN
         RETURN (FALSE);
      END_IF;
      selected_representation := property_definition_representations[1]\property_definition_representation.used_representation;
      IF (SIZEOF(selected_representation\representation.items) < 1) OR (SIZEOF(selected_representation\representation.items) > 2) THEN
         RETURN (FALSE);
      END_IF;
      IF SIZEOF(QUERY (i <* selected_representation\representation.items| (SIZEOF([ 'STEP_MERGED_AP_SCHEMA.MEASURE_REPRESENTATION_ITEM', 'STEP_MERGED_AP_SCHEMA.VALUE_RANGE' ] * TYPEOF(i)) = 1) AND (i.name = 'selection quantity'))) <> 1 THEN
         RETURN (FALSE);
      END_IF;
      IF SIZEOF(QUERY (i <* selected_representation\representation.items| ('STEP_MERGED_AP_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' IN TYPEOF(i)) AND (i.name = 'selection control'))) > 1 THEN
         RETURN (FALSE);
      END_IF;
      IF (SIZEOF(QUERY (i <* selected_representation\representation.items| ('STEP_MERGED_AP_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' IN TYPEOF(i)) AND (i.name = 'selection control'))) = 0) AND (SIZEOF(QUERY (i <* selected_representation\representation.items| (i.name = 'selection quantity') AND (SIZEOF([ 'STEP_MERGED_AP_SCHEMA.QUALIFIED_REPRESENTATION_ITEM', 'STEP_MERGED_AP_SCHEMA.VALUE_RANGE' ] * TYPEOF(i)) = 0))) > 0) THEN
         RETURN (FALSE);
      END_IF;
      RETURN (TRUE);
END_FUNCTION;

Referenced By

Defintion valid_selected_instance_representation is references by the following definitions:
DefinitionType
 restrict_part_occurrence RULE
 selected_instance_usage_requires_representation RULE


[Top Level Definitions] [Exit]

Generated by STEP Tools® EXPRESS to HTML Converter
2024-09-06T14:00:33-04:00