Beispiel #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)
        {
            HM.hMember     member = null;
            List <Point3d> points = new List <Point3d>();
            List <string>  types  = new List <string>();

            if (!DA.GetData(0, ref member))
            {
                return;
            }
            if (!DA.GetDataList(1, points))
            {
                return;
            }
            if (!DA.GetDataList(2, types))
            {
                return;
            }

            if (points.Count != types.Count)
            {
                return;
            }

            var newMember = new HM.hMember(member);

            for (int i = 0; i < points.Count; i++)
            {
                newMember.AddOperationByPointType(HMGHUtil.PointToTriple(points[i]), types[i]);
            }

            DA.SetData(0, newMember);
        }
        /// <summary>
        /// Adds operations to a member by specifiying the operation types and the points along the axis of the member at which they occur
        /// </summary>
        /// <param name="member"></param>
        /// <param name="points"></param>
        /// <param name="types"></param>
        /// <returns name="hMember">></returns>
        public hMember AddOperationByPointType(List <Geo.Point> points, List <string> types)
        {
            hMember newMember = new hMember(this);

            for (int i = 0; i < points.Count; i++)
            {
                newMember.AddOperationByPointType(points[i], types[i]);
            }
            return(newMember);
        }