예제 #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)
        {
            Model model = null;

            DA.GetData(0, ref model);

            string CCXCommand = model.BuildCCXCommand(Environment.ProcessorCount, GHUtil.CCXPath(this.OnPingDocument()));

            DA.SetData(0, CCXCommand);
        }
예제 #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)
        {
            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);
            }
        }
예제 #3
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)
        {
            bool  run     = false;
            int   threads = 0;
            Model input   = null;

            DA.GetData(0, ref run);
            DA.GetData(1, ref input);
            DA.GetData(2, ref threads);

            if (run)
            {
                Model model = input.Clone() as Model;
                model.SolveFromFile(threads, GHUtil.CCXPath(this.OnPingDocument()));
                DA.SetData(0, model);
            }
        }
예제 #4
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)
        {
            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);
        }