コード例 #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)
        {
            // Get inputs.
            string inputRobotName       = "";
            Mesh   inputEndeffectorMesh = new Mesh();
            int    inputRobotID         = 0;
            Plane  inputPlane           = this.defaultPlane;

            if (!DA.GetData(0, ref inputRobotName))
            {
                RobotOptionList();
            }
            DA.GetData(1, ref inputEndeffectorMesh);
            DA.GetData(2, ref inputRobotID);
            DA.GetData(3, ref inputPlane);
            //////////////////////////////////////////////////////
            // Process data.
            inputEndeffectorMesh.Weld(Math.PI);
            EndeffectorData endEffector = new EndeffectorData(MeshUtilities.EncodeMesh(inputEndeffectorMesh));
            RobotData       robot       = new RobotData(inputRobotID, inputRobotName, endEffector, EncodeUtilities.EncodePlane(inputPlane));

            UniversalDebug("Robot Object Created.");
            //////////////////////////////////////////////////////
            // Output.
            DA.SetData(0, robot);
                        #if DEBUG
            DA.SetData(1, this.debugMessages[this.debugMessages.Count - 1]);
                        #endif
        }