Exemplo n.º 1
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            string      inx          = null;
            bool        runIt        = false;
            GridEnvimet envimentGrid = null;

            DA.GetData(0, ref inx);
            DA.GetData(1, ref envimentGrid);
            DA.GetData(2, ref runIt);

            if (runIt)
            {
                var modelgeometry = Facade.GetGridDetail(inx);

                if (modelgeometry == null)
                {
                    this.AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "It works only with 3d detailed model for now.\n" +
                                           "Please, use ENVI-Met Spaces to convert your 2.5D model into 3D model.");
                    return;
                }

                if (envimentGrid == null)
                {
                    envimentGrid = ReadEnvimet.GetGridFromInx(modelgeometry);
                }

                var mesh = GridOutput.GetAnalysisMesh(envimentGrid, Direction);

                DA.SetData(0, mesh);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            string      inx          = null;
            bool        runIt        = false;
            bool        bake         = false;
            GridEnvimet envimentGrid = null;
            Curve       crv          = null;

            DA.GetData(0, ref inx);
            DA.GetData(1, ref envimentGrid);
            DA.GetData(2, ref runIt);
            DA.GetData(3, ref bake);
            DA.GetData(4, ref crv);

            if (runIt)
            {
                var modelgeometry = Facade.GetGridDetail(inx);
                if (modelgeometry == null)
                {
                    this.AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "It works only with 3d detailed model for now.\n" +
                                           "Please, use ENVI-Met Spaces to convert your 2.5D model into 3D model.");
                    return;
                }

                var matrix = Facade.GetFacadeSparseMatrix(inx).ToList();

                Facade face = new Facade();

                if (envimentGrid == null)
                {
                    envimentGrid = ReadEnvimet.GetGridFromInx(modelgeometry);
                }

                var facades = Facade.GenerateFacadeByDirection(matrix, envimentGrid, Direction);

                if (bake)
                {
                    Facade.BakeFacades(facades, bake, crv);
                }

                DA.SetData(0, face.GetAnalysisMesh(facades.ToList()));
            }
        }