public Inventor.MateiMateDefinition iMateMate__(object oEdge, PartComponentDefinition compDef, InferredTypeEnum inf = InferredTypeEnum.kInferredPoint) { MateiMateDefinition def = null; Inventor.Face oFace; switch (inf) { case InferredTypeEnum.kInferredLine: break; case InferredTypeEnum.kInferredPoint: def = compDef.iMateDefinitions.AddMateiMateDefinition(oEdge, 0, inf); break; case InferredTypeEnum.kNoInference: oFace = (((Edge)oEdge).Faces[1].SurfaceType == SurfaceTypeEnum.kPlaneSurface) ? ((Edge)oEdge).Faces[1] : ((Edge)oEdge).Faces[2]; def = compDef.iMateDefinitions.AddMateiMateDefinition(oFace, 0, inf); break; default: break; } return(def); }
public Inventor.MateiMateDefinition iMate__(object oEdge, AssemblyComponentDefinition compDef, double offset = 0, InferredTypeEnum inf = InferredTypeEnum.kInferredLine) { MateiMateDefinition oImate = null; Inventor.Face oFace; Inventor.Point pt; switch (inf) { case InferredTypeEnum.kInferredLine: oFace = (((Edge)oEdge).Faces[1].SurfaceType == SurfaceTypeEnum.kCylinderSurface) ? ((Edge)oEdge).Faces[1] : ((Edge)oEdge).Faces[2]; if (((Edge)oEdge).TangentiallyConnectedEdges.Count == 1) { oImate = compDef.iMateDefinitions.AddMateiMateDefinition(oFace, offset, inf, oFace.PointOnFace); } break; case InferredTypeEnum.kInferredPoint: pt = (((Edge)oEdge).Geometry as Circle).Center; oImate = compDef.iMateDefinitions.AddMateiMateDefinition(oEdge, offset, inf); break; case InferredTypeEnum.kNoInference: oFace = (((Edge)oEdge).Faces[1].SurfaceType == SurfaceTypeEnum.kPlaneSurface) ? ((Edge)oEdge).Faces[1] : ((Edge)oEdge).Faces[2]; oImate = compDef.iMateDefinitions.AddMateiMateDefinition(oFace, offset, inf); break; default: break; } return(oImate); }