예제 #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)
        {
            BasementModel model        = new BasementModel();
            List <Curve>  rails        = new List <Curve>();
            double        searchLength = 0;
            double        searchHeight = 0;

            if (!DA.GetData(0, ref model))
            {
                return;
            }
            if (!DA.GetData(1, ref rails))
            {
                return;
            }
            if (!DA.GetData(2, ref searchLength))
            {
                return;
            }
        }
예제 #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)
        {
            List <object> objects = new List <object>();

            DA.GetDataList(0, objects);

            BasementModel model = new BasementModel();

            model.solidGravity      = this.solidGravity;
            model.waterGravity      = this.waterGravity;
            model.solidWaterGravity = this.solidWaterGravity;
            model.deadLoad          = this.deadLoad;
            model.liveLoad          = this.liveLoad;
            model.deadLoadParam     = this.deadLoadParam;
            model.liveLoadParam     = this.liveLoadParam;
            model.solidParam        = this.solidParam;
            foreach (GH_ObjectWrapper output in objects)
            {
                if (output == null)
                {
                    continue;
                }
                var  objectList = output.Value;
                Type type       = objectList.GetType();
                if (type == typeof(BasementWall))
                {
                    model.walls.Add((BasementWall)objectList);
                }
                else if (type == typeof(Slab))
                {
                    model.slabs.Add((Slab)objectList);
                }
                else if (type == typeof(Solid))
                {
                    model.solids.Add((Solid)objectList);
                }
            }
            DA.SetData(0, model);
        }