/// <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) { bool run = false; Model input = null; bool reducedIntegration = false; DA.GetData(0, ref run); DA.GetData(1, ref input); DA.GetData(2, ref reducedIntegration); if (run) { Model model = input.Clone() as Model; model.MeshModelFromFile(GHUtil.GmshPath(this.OnPingDocument()), reducedIntegration); DA.SetData(0, model); } }
/// <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) { bool run = false; Model input = null; MeshUtil.GmshParams gmshParams = null; bool reducedIntegration = false; DA.GetData(0, ref run); DA.GetData(1, ref input); DA.GetData(2, ref gmshParams); DA.GetData(3, ref reducedIntegration); RhinoDoc doc = RhinoDoc.ActiveDoc; GH_Document GrasshopperDocument = this.OnPingDocument(); if (undoGH) { Rhino.RhinoApp.RunScript("_undo", false); undoGH = false; done = true; } if (run && !done) { model = input.Clone() as Model; model.MeshModel(doc, gmshParams, GHUtil.GmshPath(GrasshopperDocument), reducedIntegration); undoGH = true; GrasshopperDocument.ScheduleSolution(0, ScheduleCallback); } else if (!run) { done = false; } DA.SetData(0, model); }