示例#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)
        {
            Rhino.Geometry.Mesh mesh = new Rhino.Geometry.Mesh();
            bool isIndented          = false;

            DA.GetData(0, ref mesh);
            DA.GetData(1, ref isIndented);

            MeshMaker.Mesh mMesh = mesh.ToCustomMesh();

            DA.SetData(0, mMesh);
            DA.SetData(1, mMesh.Serialize(isIndented));
        }
示例#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)
        {
            Rhino.Geometry.Mesh mesh = new Rhino.Geometry.Mesh();
            string filePath          = "C:\\Users\\Public\\Documents\\untitled.json";
            bool   save = false;

            DA.GetData(0, ref mesh);
            DA.GetData(1, ref filePath);
            DA.GetData(2, ref save);

            MeshMaker.Mesh mMesh = mesh.ToCustomMesh();

            if (save)
            {
                StreamWriter Writer = new StreamWriter(filePath);
                Writer.Write(mMesh.Serialize());
                Writer.Close();
            }

            DA.SetData(0, filePath);
        }