/// <summary> /// Метод для создание массива шариков по концентрической сетке /// </summary> /// <param name="part">деталь</param> /// <param name="sketch">Эскиз</param> /// <param name="type">направлние</param> /// <param name="planeXOZ">плоскость XOZ</param> /// <param name="planeYOZ">плоскость YOZ</param> private static void BallsConcentricArray(ksPart part, ksEntity sketch, short type, ksEntity planeXOZ, ksEntity planeYOZ) { ksEntity rotate = part.NewEntity((short)Obj3dType.o3d_bossRotated); ksBossRotatedDefinition rotDef = rotate.GetDefinition(); rotDef.directionType = type; rotDef.SetSketch(sketch); rotDef.SetSideParam(true, 360); ksRotatedParam rotateParam = rotDef.RotatedParam(); rotate.Create(); //ОСЬ ksEntity axis = part.NewEntity((short)Obj3dType.o3d_axis2Planes); ksAxis2PlanesDefinition axisdef = axis.GetDefinition(); axisdef.SetPlane(1, planeXOZ); axisdef.SetPlane(2, planeYOZ); axis.Create(); //Массив по Кругу ksEntity circrotate = part.NewEntity((short)Obj3dType.o3d_circularCopy); ksCircularCopyDefinition cpyRotDef = circrotate.GetDefinition(); cpyRotDef.SetAxis(axis); cpyRotDef.SetCopyParamAlongDir(8, 45, false, false); EntityCollection circcoll = (cpyRotDef.GetOperationArray()); circcoll.Clear(); circcoll.Add(rotate); circrotate.Create(); }
/// <summary> /// Метод для выдавливание вращением в КОМПАС-3D /// </summary> /// <param name="part">деталь</param> /// <param name="sketch">эскиз</param> /// <param name="type">направление</param> private static void BossRotatedExtrusion(ksPart part, ksEntity sketch, short type) { ksEntity bossRotated = part.NewEntity((short)Obj3dType.o3d_bossRotated); ksBossRotatedDefinition bossRotatedDef = bossRotated.GetDefinition(); bossRotatedDef.directionType = type; bossRotatedDef.SetSketch(sketch); bossRotatedDef.SetSideParam(true, 360); ksRotatedParam rotateParam = bossRotatedDef.RotatedParam(); bossRotated.Create(); }