[MSCE C#] Modify.BooleanCut剪切问题

我在尝试用一根直线切割实体,很奇怪的是代码创建的CurveVector curVec 剪切不成功,但是把curVec 转换为 LineElement (LineElement eleTemp11 = DraftingElementSchema.ToElement(Session.Instance.GetActiveDgnModel(), curVec, null) as LineElement;)后然后提取其CurveVector (eleTemp11.GetCurveVector();)然后剪切则能成功。

            SolidKernelEntity solidKernelEntity;
            Create.BodyFromSolidPrimitive(out solidKernelEntity, sfd, Session.Instance.GetActiveDgnModelRef());

            CurveVector curVec = CurveVector.Create(CurveVector.BoundaryType.Inner);
            DSegment3d line1 = new DSegment3d(new DPoint3d(0, 0, 0), new DPoint3d(-10000 * UorPerMas, 0, 0));
            curVec.Add(CurvePrimitive.CreateLine(line1));

            BentleyStatus sdfs= Modify.BooleanCut(ref solidKernelEntity, curVec, Modify.CutDirectionMode.Both, Modify.CutDepthMode.All, 0, false,
                DVector3d.FromXYZ(10, 0, 0), 0);

下面的代码侧能成功,区别仅仅是增加了


LineElement eleTemp11 = DraftingElementSchema.ToElement(Session.Instance.GetActiveDgnModel(), curVec, null) as LineElement;
curVec = eleTemp11.GetCurveVector();

            SolidKernelEntity solidKernelEntity;
            Create.BodyFromSolidPrimitive(out solidKernelEntity, sfd, Session.Instance.GetActiveDgnModelRef());

            CurveVector curVec = CurveVector.Create(CurveVector.BoundaryType.Inner);
            DSegment3d line1 = new DSegment3d(new DPoint3d(0, 0, 0), new DPoint3d(-10000 * UorPerMas, 0, 0));
            curVec.Add(CurvePrimitive.CreateLine(line1));

            LineElement eleTemp11 = DraftingElementSchema.ToElement(Session.Instance.GetActiveDgnModel(), curVec, null) as LineElement;
            curVec = eleTemp11.GetCurveVector();

            BentleyStatus sdfs= Modify.BooleanCut(ref solidKernelEntity, curVec, Modify.CutDirectionMode.Both, Modify.CutDepthMode.All, 0, false,
                DVector3d.FromXYZ(10, 0, 0), 0);

Parents Reply Children