public override TFPerforatorList GetPerfoList() { double pipeOutsideDiam = PenInfo.pipeDiameterOutside / taskUOR.activeSubPerMaster; double length = Task.LengthCm * 10 / taskUOR.activeSubPerMaster; var angles = Task.CorrectiveAngles; BCOM.Transform3d taskTran = App.Transform3dFromMatrix3d(Task.Rotation); // ПЕРФОРАТОР BCOM.EllipseElement perfoEl = App.CreateEllipseElement2(null, App.Point3dZero(), pipeOutsideDiam / 2, pipeOutsideDiam / 2, App.Matrix3dIdentity(), BCOM.MsdFillMode.Filled); { BCOM.Point3d offset = App.Point3dAddScaled( App.Point3dZero(), App.Point3dFromXYZ(0, 0, 1), length / 2); perfoEl.Move(offset); perfoEl.Rotate(App.Point3dZero(), angles.X, angles.Y, angles.Z); } perfoEl.Level = ElementHelper.GetOrCreateLevel(PenConfigVariables.PerfoLevel); ElementHelper.setSymbologyByLevel(perfoEl); perfoEl.Transform(taskTran); perfoEl.Move(Task.Location); BCOM.Point3d perfoVec = perfoEl.Normal; TFCOM.TFPerforatorList perfoList = AppTF.CreateTFPerforator(); var tranIdentity = App.Transform3dIdentity(); perfoList.InitFromElement(perfoEl, perfoVec, length / 2 * 1.01, tranIdentity); return(perfoList); }
public void AddPerforation() { if (IsPerforationAdded_) { return; } TFCOM.TFPerforatorList perfoList = AppTF.CreateTFPerforator(); BCOM.ShapeElement perfoContour = Task.GetContourShape(BCOM.MsdFillMode.Filled); perfoList.InitFromElement(perfoContour, Task.DepthVec, Task.Depth * 1.01, App.Transform3dIdentity()); perfoList.SetSweepMode( TFCOM.TFdPerforatorSweepMode.tfdPerforatorSweepModeBi); //perfoList.SetSenseDist(1.01 * length / 2); perfoList.SetPolicy( TFCOM.TFdPerforatorPolicy.tfdPerforatorPolicyThroughHoleWithinSenseDist); perfoList.SetIsVisible(false); FrameList.AsTFFrame.SetPerforatorList(perfoList); FrameList.AsTFFrame.SetSenseDistance2(Task.Depth); FrameList.AsTFFrame.SetPerforatorsAreActive(true); FrameList.Synchronize(string.Empty); FrameList.ApplyPerforatorInModel(); IsPerforationAdded_ = true; }
public static void addPerforator(TFCOM.TFFrameList frameList, IPenetrTask task, PenetrInfo penInfo, BCOM.Level levelSymb, bool isVisible) { var taskUOR = new UOR(task.ModelRef); double pipeInsideDiam = penInfo.pipeDiameterInside / taskUOR.activeSubPerMaster; double pipeOutsideDiam = penInfo.pipeDiameterOutside / taskUOR.activeSubPerMaster; double flangeInsideDiam = penInfo.flangeDiameterInside / taskUOR.activeSubPerMaster; double flangeOutsideDiam = penInfo.flangeDiameterOutside / taskUOR.activeSubPerMaster; double flangeThick = penInfo.flangeThick / taskUOR.activeSubPerMaster; double length = task.LengthCm * 10 / taskUOR.activeSubPerMaster; var angles = task.CorrectiveAngles; BCOM.Transform3d taskTran = App.Transform3dFromMatrix3d(task.Rotation); // ПЕРФОРАТОР BCOM.EllipseElement perfoEl = App.CreateEllipseElement2(null, App.Point3dZero(), pipeInsideDiam / 2, pipeInsideDiam / 2, App.Matrix3dIdentity(), BCOM.MsdFillMode.Filled); { BCOM.Point3d offset = App.Point3dAddScaled( App.Point3dZero(), App.Point3dFromXYZ(0, 0, 1), length / 2); perfoEl.Move(offset); perfoEl.Rotate(App.Point3dZero(), angles.X, angles.Y, angles.Z); } perfoEl.Level = levelSymb; ElementHelper.setSymbologyByLevel(perfoEl); perfoEl.Transform(taskTran); perfoEl.Move(task.Location); BCOM.Point3d perfoVec = perfoEl.Normal; TFCOM.TFPerforatorList perfoList = AppTF.CreateTFPerforator(); var tranIdentity = App.Transform3dIdentity(); perfoList.InitFromElement(perfoEl, perfoVec, length / 2 * 1.01, tranIdentity); perfoList.SetSweepMode( TFCOM.TFdPerforatorSweepMode.tfdPerforatorSweepModeBi); //perfoList.SetSenseDist(1.01 * length / 2); perfoList.SetPolicy( TFCOM.TFdPerforatorPolicy.tfdPerforatorPolicyThroughHoleWithinSenseDist); perfoList.SetIsVisible(isVisible); frameList.AsTFFrame.SetPerforatorList(perfoList); frameList.AsTFFrame.SetSenseDistance2(length / 2); frameList.AsTFFrame.SetPerforatorsAreActive(true); frameList.Synchronize(); { // ! без этого кода не срабатывает перфорация в стенке/плите // судя по всему инициализирует обновление объектов, с которыми // взаимодействует frame AppTF.ModelReferenceUpdateAutoOpeningsByFrame( App.ActiveModelReference, frameList.AsTFFrame, true, false, TFCOM.TFdFramePerforationPolicy.tfdFramePerforationPolicyNone); } }