/// <summary> /// SetShapRelationShip /// </summary> /// <param name="inputItem"></param> /// <param name="itemType"></param> public void SetShapRelationShip(StepRepresentationItem inputItem, StepItemType itemType) { foreach (var eachItem in _file.Items) { if (inputItem == eachItem) { continue; } if (eachItem.GetStepItemTypeStr() == itemType.ToString()) { List <StepRepresentationItem> relatedItems = GetItemsRelationShip(inputItem, eachItem); if (relatedItems.Count > 0) { foreach (var refObj in eachItem.RefChildItems) { if (refObj.Value != null && refObj.Value.Count > 0) { foreach (var refItem in refObj.Value) { if (relatedItems.Find(x => x == refItem) == null) { inputItem.AddRefObjs((StepRepresentationItem)refItem); inputItem.ContainCrossRef = true; //Contains cross ref item refItem.IsCrossRef = true; } } } } } } } }
public const string FaceSurfaceText = "FACE_SURFACE"; //Tien added on Mar 21 2020 public static string GetItemTypeString(this StepItemType type) { switch (type) { case StepItemType.Product: return(ProductText); case StepItemType.ProductDefinition: return(ProductDefinitionText); case StepItemType.ProductDefinitionShape: return(ProductDefinitionShapeText); case StepItemType.ProductDefinitionFormationWithSpecifiedSource: return(ProductDefinitionFormationWithSpecifiedSourceText); case StepItemType.ShapeDefinitionRepresentation: return(ShapeDefinitionRepresentationText); case StepItemType.ShapeRepresentationRelationship: return(ShapeRepresentationRelationshipText); case StepItemType.ShapeRepresentation: return(ShapeRepresentationText); case StepItemType.AdvancedBrepShapeRepresentation: return(AdvancedBrepShapeRepresentationText); case StepItemType.ManiFoldSolidBrep: return(ManiFoldSolidBrepText); case StepItemType.ClosedShell: return(ClosedShellText); case StepItemType.AdvancedFace: return(AdvancedFaceText); case StepItemType.AxisPlacement2D: return(Axis2Placement2DText); case StepItemType.AxisPlacement3D: return(Axis2Placement3DText); case StepItemType.BSplineCurveWithKnots: return(BSplineCurveWithKnotsText); case StepItemType.CartesianPoint: return(CartesianPointText); case StepItemType.Circle: return(CircleText); case StepItemType.CylindricalSurface: return(CylindricalSurfaceText); case StepItemType.Direction: return(DirectionText); case StepItemType.EdgeCurve: return(EdgeCurveText); case StepItemType.EdgeLoop: return(EdgeLoopText); case StepItemType.Ellipse: return(EllipseText); case StepItemType.FaceBound: return(FaceBoundText); case StepItemType.FaceOuterBound: return(FaceOuterBoundText); case StepItemType.Line: return(LineText); case StepItemType.OrientedEdge: return(OrientedEdgeText); case StepItemType.Plane: return(PlaneText); case StepItemType.Vector: return(VectorText); case StepItemType.VertexPoint: return(VertexPointText); case StepItemType.StyledItem: return(StyledItemText); case StepItemType.PresentationStyleAssignment: return(PresentationStyleAssignmentText); case StepItemType.SurfaceStyleUsage: return(SurfaceStyleUsageText); case StepItemType.SurfaceSideStyle: return(SurfaceSideStyleText); case StepItemType.SurfaceStyleFillArea: return(SurfaceStyleFillAreaText); case StepItemType.FillAreaStyle: return(FillAreaStyleText); case StepItemType.FillAreaStyleColour: return(FillAreaStyleColourText); case StepItemType.ColourRGB: return(ColourRGBText); case StepItemType.NextAssemblyUsageOccurrence: return(NextAssemblyUsageOccurrenceText); case StepItemType.FaceSurface: return(FaceSurfaceText); default: return(type.ToString()); //throw new InvalidOperationException("Unexpected item type " + type); } }