FUNCTION valid_selected_instance_representation
(* SCHEMA Ap242_managed_model_based_3d_engineering_mim_LF; *)
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 ,'AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.PROPERTY_DEFINITION.DEFINITION' ) |
(prd.name = 'occurrence selection' )));
property_definition_representations: SET OF property_definition_representation := bag_to_set(QUERY ( pdr <* USEDIN ( properties[1] , 'AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.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 (['AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.MEASURE_REPRESENTATION_ITEM' ,
'AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.VALUE_RANGE']* TYPEOF ( i ) ) = 1) AND
( i.name = 'selection quantity' ))) <> 1 ) THEN
RETURN(FALSE);
END_IF;
IF (SIZEOF ( QUERY ( i <* selected_representation\representation.items |
( 'AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.DESCRIPTIVE_REPRESENTATION_ITEM' IN TYPEOF ( i ) ) AND
( i.name = 'selection control' )))> 1) THEN
RETURN(FALSE);
END_IF; --the selection control is not specified then the quantity shall be a qualified_representation_item or a value_range
IF (SIZEOF ( QUERY ( i <* selected_representation\representation.items |
( 'AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.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(['AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.QUALIFIED_REPRESENTATION_ITEM' ,
'AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.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:
[Top Level Definitions] [Exit]Generated by STEP Tools® EXPRESS to HTML Converter
2012-03-27T17:20:10-04:00