示例#1
0
        public void ClosedCurve()
        {
            var model = dynSettings.Controller.DynamoModel;

            string samplePath = Path.Combine(_testPath, @".\ClosedCurve.dyn");
            string testPath   = Path.GetFullPath(samplePath);

            model.Open(testPath);
            dynSettings.Controller.RunExpression(true);

            var          extrudeNode     = dynSettings.Controller.DynamoModel.Nodes.Where(x => x is CreateExtrusionGeometry).First();
            dynSolidBase nodeAsSolidBase = (dynSolidBase)extrudeNode;
            Solid        result          = nodeAsSolidBase.resultingSolidForTestRun().First();
            double       volumeMin       = 3850;
            double       volumeMax       = 4050;
            double       actualVolume    = result.Volume;

            Assert.Greater(actualVolume, volumeMin);
            Assert.Less(actualVolume, volumeMax);
        }
示例#2
0
        public void SweepToMakeSolid()
        {
            var model = dynSettings.Controller.DynamoModel;

            string samplePath = Path.Combine(_testPath, @".\SweepToMakeSolid.dyn");
            string testPath   = Path.GetFullPath(samplePath);

            model.Open(testPath);
            dynSettings.Controller.RunExpression(true);

            var          sweepNode       = dynSettings.Controller.DynamoModel.Nodes.Where(x => x is CreateSweptGeometry).First();
            dynSolidBase nodeAsSolidBase = (dynSolidBase)sweepNode;
            Solid        result          = nodeAsSolidBase.resultingSolidForTestRun().First();
            double       volumeMin       = 11800.0;
            double       volumeMax       = 12150.0;
            double       actualVolume    = result.Volume;

            Assert.Greater(actualVolume, volumeMin);
            Assert.Less(actualVolume, volumeMax);
        }
示例#3
0
        public void RevolveSolid()
        {
            DynamoViewModel vm = dynSettings.Controller.DynamoViewModel;

            string samplePath = Path.Combine(_testPath, @".\RevolveSolid.dyn");
            string testPath   = Path.GetFullPath(samplePath);

            dynSettings.Controller.RunCommand(vm.OpenCommand, testPath);
            dynSettings.Controller.RunCommand(vm.RunExpressionCommand, true);

            var          revolveNode     = dynSettings.Controller.DynamoModel.Nodes.Where(x => x is CreateRevolvedGeometry).First();
            dynSolidBase nodeAsSolidBase = (dynSolidBase)revolveNode;
            Solid        result          = nodeAsSolidBase.resultingSolidForTestRun().First();
            double       volumeMin       = 13300.0;
            double       volumeMax       = 13550.0;
            double       actualVolume    = result.Volume;

            Assert.Greater(actualVolume, volumeMin);
            Assert.Less(actualVolume, volumeMax);
        }
示例#4
0
        public void SolidBySkeleton()
        {
            if (!dynRevitSettings.Revit.Application.VersionNumber.Contains("2013") &&
                dynRevitSettings.Revit.Application.VersionName.Contains("Vasari"))
            {
                var model = dynSettings.Controller.DynamoModel;

                string samplePath = Path.Combine(_testPath, @".\SolidBySkeleton.dyn");
                string testPath   = Path.GetFullPath(samplePath);

                model.Open(testPath);
                dynSettings.Controller.RunExpression(true);

                var          skeletonNode    = dynSettings.Controller.DynamoModel.Nodes.Where(x => x is dynSkinCurveLoops).First();
                dynSolidBase nodeAsSolidBase = (dynSolidBase)skeletonNode;
                Solid        result          = nodeAsSolidBase.resultingSolidForTestRun().First();
                double       volumeMin       = 82500.0;
                double       volumeMax       = 84500.0;
                double       actualVolume    = result.Volume;
                Assert.Greater(actualVolume, volumeMin);
                Assert.Less(actualVolume, volumeMax);
            }
        }