Exemple #1
0
        public void TestCutBySketch(ErrorCodes errorCode, Obj3dType extrusionType, Direction_Type directionType)
        {
            var appTest = new KompasApplicationTest();
            var app     = appTest.CreateKompasApplication();
            var sketch  = CreateSketchWithCirle(app);

            var extrusionParameters = new KompasExtrusionParameters(app.ScrewPart, Obj3dType.o3d_baseExtrusion, sketch, directionType, 10);
            var extrusion           = new KompasExtrusion(extrusionParameters, ExtrusionType.ByEntity);

            Assert.AreEqual(extrusion.LastErrorCode, errorCode);

            Direction_Type cutExtrusionDirection = Direction_Type.dtBoth;

            if (directionType == Direction_Type.dtNormal)
            {
                cutExtrusionDirection = Direction_Type.dtReverse;
            }
            else if (directionType == Direction_Type.dtReverse)
            {
                cutExtrusionDirection = Direction_Type.dtNormal;
            }

            extrusionParameters = new KompasExtrusionParameters(app.ScrewPart, extrusionType, sketch, cutExtrusionDirection, 10);
            var cutExtrusion = new KompasExtrusion(extrusionParameters, ExtrusionType.ByEntity);

            Assert.AreEqual(cutExtrusion.LastErrorCode, errorCode);
        }
Exemple #2
0
        public void CreateOnNull(ErrorCodes errorCode, ksEntity entity)
        {
            var appTest = new KompasApplicationTest();
            var app     = appTest.CreateKompasApplication();

            var sketch = new KompasSketch(app.ScrewPart, entity);

            Assert.AreEqual(sketch.LastErrorCode, errorCode);
        }
Exemple #3
0
        public void CreateOnBasePlaneAxis(ErrorCodes errorCode, Obj3dType basePlaneAxis)
        {
            var appTest = new KompasApplicationTest();
            var app     = appTest.CreateKompasApplication();

            var sketch = new KompasSketch(app.ScrewPart, basePlaneAxis);

            Assert.AreEqual(sketch.LastErrorCode, errorCode);
        }
Exemple #4
0
        public void CutBySketchUnsupportedDirection(ErrorCodes errorCode, Obj3dType extrusionType, Direction_Type directionType)
        {
            var appTest = new KompasApplicationTest();
            var app     = appTest.CreateKompasApplication();
            var sketch  = CreateSketchWithCirle(app);

            var extrusionParameters = new KompasExtrusionParameters(app.ScrewPart, Obj3dType.o3d_baseExtrusion, sketch, directionType, 10);
            var extrusion           = new KompasExtrusion(extrusionParameters, ExtrusionType.ByEntity);

            Assert.AreEqual(extrusion.LastErrorCode, errorCode);
        }
Exemple #5
0
        public void TestRectangleParameterNormal(ErrorCodes errorCode, double width, double height)
        {
            var appTest = new KompasApplicationTest();
            var app     = appTest.CreateKompasApplication();

            var sketch     = new KompasSketch(app.ScrewPart, Obj3dType.o3d_planeXOZ);
            var sketchEdit = sketch.BeginEntityEdit();

            var rectangleParam = new RectangleParameter(app, width, height, new KompasPoint2D(0.0, 0.0));

            sketchEdit.ksRectangle(rectangleParam.FigureParam);
            sketch.EndEntityEdit();

            Assert.AreEqual(rectangleParam.LastErrorCode, errorCode);
        }