Example #1
0
        public void BuildArc(HouseProperties houseProperties)
        {
            var startPoint  = _houseProperties.GetParameter(ParameterType.StartPoint).Value;
            var arcHeight   = _houseProperties.GetParameter(ParameterType.ArcHeight).Value;
            var arcWidth    = _houseProperties.GetParameter(ParameterType.ArcWidth).Value;
            var houseLength = _houseProperties.GetParameter(ParameterType.HouseLength).Value;

            _api.MakeNewWorkingPlane(3, 0);
            _api.CutExtrudeRectangle(startPoint, 0, arcWidth + startPoint, arcHeight, houseLength);
        }
Example #2
0
        /// <summary>
        /// Функция строит модель
        /// </summary>
        public void Build(HouseProperties houseProperties)
        {
            var windowsRow        = _houseProperties.GetParameter(ParameterType.WindowsRow).Value;
            var houseLength       = _houseProperties.GetParameter(ParameterType.HouseLength).Value;
            var floorsCount       = _houseProperties.GetParameter(ParameterType.FloorsCount).Value;
            var windowHeight      = _houseProperties.GetParameter(ParameterType.WindowHeight).Value;
            var windowWidth       = _houseProperties.GetParameter(ParameterType.WindowWidth).Value;
            var windowDistanceHor = _houseProperties.GetParameter(ParameterType.WindowDistanceHor).Value;
            var windowDistanceVer = _houseProperties.GetParameter(ParameterType.WindowDistanceVer).Value;
            var balconHeight      = _houseProperties.GetParameter(ParameterType.BalconHeight).Value;
            var balconWidth       = _houseProperties.GetParameter(ParameterType.BalconWidth).Value;
            var balconLength      = _houseProperties.GetParameter(ParameterType.BalconLength).Value;
            var doorHeight        = _houseProperties.GetParameter(ParameterType.DoorHeight).Value;
            var doorWidth         = _houseProperties.GetParameter(ParameterType.DoorWidth).Value;
            var peakLength        = _houseProperties.GetParameter(ParameterType.PeakLength).Value;



            double houseHeight;
            double houseWidth;
            double balconRow;
            double doorDistance = 20.0;
            double peakHeight   = 2.0;
            double lowDistance  = 5.0;


            houseHeight = (windowHeight + windowDistanceVer) * floorsCount + doorHeight + doorDistance + peakHeight + lowDistance;
            houseWidth  = (windowWidth + windowDistanceHor) * windowsRow + windowDistanceHor / 2;

            if (windowsRow % 3 == 2)
            {
                balconRow = Convert.ToInt32(windowsRow / 3) - 1;
            }
            else
            {
                balconRow = Convert.ToInt32(windowsRow / 3);
            }



            ArrayList houseBuildingParameters = new ArrayList();

            houseBuildingParameters.Add(houseWidth);
            houseBuildingParameters.Add(houseLength);
            houseBuildingParameters.Add(floorsCount);
            houseBuildingParameters.Add(windowHeight);
            houseBuildingParameters.Add(windowWidth);
            houseBuildingParameters.Add(windowDistanceHor);
            houseBuildingParameters.Add(windowDistanceVer);
            houseBuildingParameters.Add(balconHeight);
            houseBuildingParameters.Add(balconWidth);
            houseBuildingParameters.Add(balconLength);
            houseBuildingParameters.Add(doorHeight);
            houseBuildingParameters.Add(doorWidth);
            houseBuildingParameters.Add(peakLength);
            houseBuildingParameters.Add(windowsRow);
            houseBuildingParameters.Add(houseHeight);
            houseBuildingParameters.Add(doorDistance);
            houseBuildingParameters.Add(peakHeight);
            houseBuildingParameters.Add(lowDistance);
            houseBuildingParameters.Add(balconRow);



            if (houseProperties == null)
            {
                throw new AccessingNullException();
            }
            BuildHouse(houseBuildingParameters);
            BuildWindows(houseBuildingParameters);
            BuildBalcons(houseBuildingParameters);
            BuildRoof(houseBuildingParameters);
            BuildPeak(houseBuildingParameters);
            BuildDoor(houseBuildingParameters);
        }
Example #3
0
 /// <summary>
 /// Конструктор с входными параметрами модели
 /// </summary>
 /// <param name="houseProperties">Параметры модели</param>
 /// <param name="inventorApi"></param>
 public HouseModel(HouseProperties houseProperties, InventorApi inventorApi)
 {
     _houseProperties    = houseProperties;
     _api                = inventorApi;
     InventorApplication = inventorApi.InventorApplication;
 }
Example #4
0
        /// <summary>
        /// Функция строит модель
        /// </summary>
        public void Build(HouseProperties houseProperties)
        {
            var windowsRow = _houseProperties.GetParameter(ParameterType.WindowsRow).Value;
            var houseLength = _houseProperties.GetParameter(ParameterType.HouseLength).Value;
            var floorsCount = _houseProperties.GetParameter(ParameterType.FloorsCount).Value;
            var windowHeight = _houseProperties.GetParameter(ParameterType.WindowHeight).Value;
            var windowWidth = _houseProperties.GetParameter(ParameterType.WindowWidth).Value;
            var windowDistanceHor = _houseProperties.GetParameter(ParameterType.WindowDistanceHor).Value;
            var windowDistanceVer = _houseProperties.GetParameter(ParameterType.WindowDistanceVer).Value;
            var balconHeight = _houseProperties.GetParameter(ParameterType.BalconHeight).Value;
            var balconWidth = _houseProperties.GetParameter(ParameterType.BalconWidth).Value;
            var balconLength = _houseProperties.GetParameter(ParameterType.BalconLength).Value;
            var doorHeight = _houseProperties.GetParameter(ParameterType.DoorHeight).Value;
            var doorWidth = _houseProperties.GetParameter(ParameterType.DoorWidth).Value;
            var peakLength = _houseProperties.GetParameter(ParameterType.PeakLength).Value;




            double houseHeight;
            double houseWidth;
            double balconRow;
            double doorDistance = 20.0;
            double peakHeight = 2.0;
            double lowDistance = 5.0;


            houseHeight = (windowHeight + windowDistanceVer) * floorsCount + doorHeight + doorDistance + peakHeight + lowDistance;
            houseWidth = (windowWidth + windowDistanceHor) * windowsRow + windowDistanceHor / 2;

            if (windowsRow%3 == 2)
            {
                
                balconRow = Convert.ToInt32(windowsRow / 3) - 1;
            }
            else
            {
                
                balconRow = Convert.ToInt32(windowsRow / 3);
            }
            
            


            ArrayList houseBuildingParameters = new ArrayList();

            houseBuildingParameters.Add(houseWidth);
            houseBuildingParameters.Add(houseLength);
            houseBuildingParameters.Add(floorsCount);
            houseBuildingParameters.Add(windowHeight);
            houseBuildingParameters.Add(windowWidth);
            houseBuildingParameters.Add(windowDistanceHor);
            houseBuildingParameters.Add(windowDistanceVer);
            houseBuildingParameters.Add(balconHeight);
            houseBuildingParameters.Add(balconWidth);
            houseBuildingParameters.Add(balconLength);
            houseBuildingParameters.Add(doorHeight);
            houseBuildingParameters.Add(doorWidth);
            houseBuildingParameters.Add(peakLength);
            houseBuildingParameters.Add(windowsRow);
            houseBuildingParameters.Add(houseHeight);
            houseBuildingParameters.Add(doorDistance);
            houseBuildingParameters.Add(peakHeight);
            houseBuildingParameters.Add(lowDistance);
            houseBuildingParameters.Add(balconRow);




            if (houseProperties == null) throw new AccessingNullException();
            BuildHouse(houseBuildingParameters);
            BuildWindows(houseBuildingParameters);
            BuildBalcons(houseBuildingParameters);
            BuildRoof(houseBuildingParameters);
            BuildPeak(houseBuildingParameters);
            BuildDoor(houseBuildingParameters);
        }
Example #5
0
 /// <summary>
 /// Конструктор с входными параметрами модели
 /// </summary>
 /// <param name="houseProperties">Параметры модели</param>
 /// <param name="inventorApi"></param>
 public HouseModel(HouseProperties houseProperties, InventorApi inventorApi)
 {
     _houseProperties = houseProperties;
     _api = inventorApi;
     InventorApplication = inventorApi.InventorApplication;
 }
Example #6
0
        public void BuildArc(HouseProperties houseProperties)
        {
            var startPoint = _houseProperties.GetParameter(ParameterType.StartPoint).Value;
            var arcHeight = _houseProperties.GetParameter(ParameterType.ArcHeight).Value;
            var arcWidth = _houseProperties.GetParameter(ParameterType.ArcWidth).Value;
            var houseLength = _houseProperties.GetParameter(ParameterType.HouseLength).Value;

            _api.MakeNewWorkingPlane(3, 0);
            _api.CutExtrudeRectangle(startPoint, 0, arcWidth + startPoint, arcHeight, houseLength);
        }