FUNCTION in_2d_assembly_context
(comp : assembly_component_armx) : LOGICAL;
LOCAL shapes : SET OF Assembly_component_2d_shape_model := []; shapes_in_context : SET OF Physical_unit_planar_shape_model := []; assemblies : SET OF Product_view_definition := []; i, j : INTEGER := 0; in_context : LOGICAL := TRUE; END_LOCAL; REPEAT i := 1 TO SIZEOF(comp.occurrence_contexts); assemblies := assemblies + comp.occurrence_contexts[i].relating_view; END_REPEAT;
shapes := bag_to_set(USEDIN(comp,'PHYSICAL_UNIT_2D_DESIGN_VIEW_XIM.ASSEMBLY_COMPONENT_2D_SHAPE_MODEL.SHAPE_CHARACTERIZED_COMPONENT')); REPEAT i := 1 TO SIZEOF(shapes); shapes_in_context := bag_to_set(USEDIN(shapes[i]\Shape_representation.context_of_items,'ELEMENTAL_GEOMETRIC_SHAPE_XIM.SHAPE_REPRESENTATION.CONTEXT_OF_ITEMS')); in_context := FALSE; j := 1; REPEAT WHILE ((j <= SIZEOF(shapes_in_context)) AND (NOT(in_context))); in_context := (shapes_in_context[j].shape_characterized_definition IN assemblies); j := j + 1; END_REPEAT; IF NOT (in_context) THEN RETURN (FALSE); END_IF; END_REPEAT; RETURN (SIZEOF(shapes) > 0); END_FUNCTION; -- in_2d_assembly_context
|