private int runCount; //Legacy field. public override void InvokeRunScript(IGH_Component owner, object rhinoDocument, int iteration, List <object> inputs, IGH_DataAccess DA) { //Prepare for a new run... //1. Reset lists this.__out.Clear(); this.__err.Clear(); this.Component = owner; this.Iteration = iteration; this.GrasshopperDocument = owner.OnPingDocument(); this.RhinoDocument = rhinoDocument as Rhino.RhinoDoc; this.owner = this.Component; this.runCount = this.Iteration; this.doc = this.RhinoDocument; //2. Assign input parameters List <Plane> Pl = null; if (inputs[0] != null) { Pl = GH_DirtyCaster.CastToList <Plane>(inputs[0]); } List <int> id = null; if (inputs[1] != null) { id = GH_DirtyCaster.CastToList <int>(inputs[1]); } List <Polyline> body = null; if (inputs[2] != null) { body = GH_DirtyCaster.CastToList <Polyline>(inputs[2]); } //3. Declare output parameters object A = null; //4. Invoke RunScript RunScript(Pl, id, body, ref A); try { //5. Assign output parameters to component... if (A != null) { if (GH_Format.TreatAsCollection(A)) { IEnumerable __enum_A = (IEnumerable)(A); DA.SetDataList(1, __enum_A); } else { if (A is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(1, (Grasshopper.Kernel.Data.IGH_DataTree)(A)); } else { //assign direct DA.SetData(1, A); } } } else { DA.SetData(1, null); } } catch (Exception ex) { this.__err.Add(string.Format("Script exception: {0}", ex.Message)); } finally { //Add errors and messages... if (owner.Params.Output.Count > 0) { if (owner.Params.Output[0] is Grasshopper.Kernel.Parameters.Param_String) { List <string> __errors_plus_messages = new List <string>(); if (this.__err != null) { __errors_plus_messages.AddRange(this.__err); } if (this.__out != null) { __errors_plus_messages.AddRange(this.__out); } if (__errors_plus_messages.Count > 0) { DA.SetDataList(0, __errors_plus_messages); } } } } }
private int runCount; //Legacy field. public override void InvokeRunScript(IGH_Component owner, object rhinoDocument, int iteration, List <object> inputs, IGH_DataAccess DA) { //Prepare for a new run... //1. Reset lists this.__out.Clear(); this.__err.Clear(); this.Component = owner; this.Iteration = iteration; this.GrasshopperDocument = owner.OnPingDocument(); this.RhinoDocument = rhinoDocument as Rhino.RhinoDoc; this.owner = this.Component; this.runCount = this.Iteration; this.doc = this.RhinoDocument; //2. Assign input parameters int n = default(int); if (inputs[0] != null) { n = (int)(inputs[0]); } double step = default(double); if (inputs[1] != null) { step = (double)(inputs[1]); } //3. Declare output parameters object P = null; //4. Invoke RunScript RunScript(n, step, ref P); try { //5. Assign output parameters to component... if (P != null) { if (GH_Format.TreatAsCollection(P)) { IEnumerable __enum_P = (IEnumerable)(P); DA.SetDataList(1, __enum_P); } else { if (P is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(1, (Grasshopper.Kernel.Data.IGH_DataTree)(P)); } else { //assign direct DA.SetData(1, P); } } } else { DA.SetData(1, null); } } catch (Exception ex) { this.__err.Add(string.Format("Script exception: {0}", ex.Message)); } finally { //Add errors and messages... if (owner.Params.Output.Count > 0) { if (owner.Params.Output[0] is Grasshopper.Kernel.Parameters.Param_String) { List <string> __errors_plus_messages = new List <string>(); if (this.__err != null) { __errors_plus_messages.AddRange(this.__err); } if (this.__out != null) { __errors_plus_messages.AddRange(this.__out); } if (__errors_plus_messages.Count > 0) { DA.SetDataList(0, __errors_plus_messages); } } } } }
private int runCount; //Legacy field. public override void InvokeRunScript(IGH_Component owner, object rhinoDocument, int iteration, List <object> inputs, IGH_DataAccess DA) { //Prepare for a new run... //1. Reset lists this.__out.Clear(); this.__err.Clear(); this.Component = owner; this.Iteration = iteration; this.GrasshopperDocument = owner.OnPingDocument(); this.RhinoDocument = rhinoDocument as Rhino.RhinoDoc; this.owner = this.Component; this.runCount = this.Iteration; this.doc = this.RhinoDocument; //2. Assign input parameters //3. Declare output parameters object A = null; object B = null; object C = null; object D = null; //4. Invoke RunScript RunScript(ref A, ref B, ref C, ref D); try { //5. Assign output parameters to component... if (A != null) { if (GH_Format.TreatAsCollection(A)) { IEnumerable __enum_A = (IEnumerable)(A); DA.SetDataList(1, __enum_A); } else { if (A is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(1, (Grasshopper.Kernel.Data.IGH_DataTree)(A)); } else { //assign direct DA.SetData(1, A); } } } else { DA.SetData(1, null); } if (B != null) { if (GH_Format.TreatAsCollection(B)) { IEnumerable __enum_B = (IEnumerable)(B); DA.SetDataList(2, __enum_B); } else { if (B is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(2, (Grasshopper.Kernel.Data.IGH_DataTree)(B)); } else { //assign direct DA.SetData(2, B); } } } else { DA.SetData(2, null); } if (C != null) { if (GH_Format.TreatAsCollection(C)) { IEnumerable __enum_C = (IEnumerable)(C); DA.SetDataList(3, __enum_C); } else { if (C is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(3, (Grasshopper.Kernel.Data.IGH_DataTree)(C)); } else { //assign direct DA.SetData(3, C); } } } else { DA.SetData(3, null); } if (D != null) { if (GH_Format.TreatAsCollection(D)) { IEnumerable __enum_D = (IEnumerable)(D); DA.SetDataList(4, __enum_D); } else { if (D is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(4, (Grasshopper.Kernel.Data.IGH_DataTree)(D)); } else { //assign direct DA.SetData(4, D); } } } else { DA.SetData(4, null); } } catch (Exception ex) { this.__err.Add(string.Format("Script exception: {0}", ex.Message)); } finally { //Add errors and messages... if (owner.Params.Output.Count > 0) { if (owner.Params.Output[0] is Grasshopper.Kernel.Parameters.Param_String) { List <string> __errors_plus_messages = new List <string>(); if (this.__err != null) { __errors_plus_messages.AddRange(this.__err); } if (this.__out != null) { __errors_plus_messages.AddRange(this.__out); } if (__errors_plus_messages.Count > 0) { DA.SetDataList(0, __errors_plus_messages); } } } } }
private int runCount; //Legacy field. public override void InvokeRunScript(IGH_Component owner, object rhinoDocument, int iteration, List<object> inputs, IGH_DataAccess DA) { //Prepare for a new run... //1. Reset lists this.__out.Clear(); this.__err.Clear(); this.Component = owner; this.Iteration = iteration; this.GrasshopperDocument = owner.OnPingDocument(); this.RhinoDocument = rhinoDocument as Rhino.RhinoDoc; this.owner = this.Component; this.runCount = this.Iteration; this. doc = this.RhinoDocument; //2. Assign input parameters List<Point3d> P = null; if (inputs[0] != null) { P = GH_DirtyCaster.CastToList<Point3d>(inputs[0]); } int deg = default(int); if (inputs[1] != null) { deg = (int)(inputs[1]); } bool periodic = default(bool); if (inputs[2] != null) { periodic = (bool)(inputs[2]); } //3. Declare output parameters object Pl = null; object C = null; //4. Invoke RunScript RunScript(P, deg, periodic, ref Pl, ref C); try { //5. Assign output parameters to component... if (Pl != null) { if (GH_Format.TreatAsCollection(Pl)) { IEnumerable __enum_Pl = (IEnumerable)(Pl); DA.SetDataList(1, __enum_Pl); } else { if (Pl is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(1, (Grasshopper.Kernel.Data.IGH_DataTree)(Pl)); } else { //assign direct DA.SetData(1, Pl); } } } else { DA.SetData(1, null); } if (C != null) { if (GH_Format.TreatAsCollection(C)) { IEnumerable __enum_C = (IEnumerable)(C); DA.SetDataList(2, __enum_C); } else { if (C is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(2, (Grasshopper.Kernel.Data.IGH_DataTree)(C)); } else { //assign direct DA.SetData(2, C); } } } else { DA.SetData(2, null); } } catch (Exception ex) { this.__err.Add(string.Format("Script exception: {0}", ex.Message)); } finally { //Add errors and messages... if (owner.Params.Output.Count > 0) { if (owner.Params.Output[0] is Grasshopper.Kernel.Parameters.Param_String) { List<string> __errors_plus_messages = new List<string>(); if (this.__err != null) { __errors_plus_messages.AddRange(this.__err); } if (this.__out != null) { __errors_plus_messages.AddRange(this.__out); } if (__errors_plus_messages.Count > 0) DA.SetDataList(0, __errors_plus_messages); } } } }
private int runCount; //Legacy field. public override void InvokeRunScript(IGH_Component owner, object rhinoDocument, int iteration, List <object> inputs, IGH_DataAccess DA) { //Prepare for a new run... //1. Reset lists this.__out.Clear(); this.__err.Clear(); this.Component = owner; this.Iteration = iteration; this.GrasshopperDocument = owner.OnPingDocument(); this.RhinoDocument = rhinoDocument as Rhino.RhinoDoc; this.owner = this.Component; this.runCount = this.Iteration; this.doc = this.RhinoDocument; //2. Assign input parameters List <Line> lines_in = null; if (inputs[0] != null) { lines_in = GH_DirtyCaster.CastToList <Line>(inputs[0]); } double tolerance = default(double); if (inputs[1] != null) { tolerance = (double)(inputs[1]); } double width = default(double); if (inputs[2] != null) { width = (double)(inputs[2]); } double deviation = default(double); if (inputs[3] != null) { deviation = (double)(inputs[3]); } double angle = default(double); if (inputs[4] != null) { angle = (double)(inputs[4]); } int n_u = default(int); if (inputs[5] != null) { n_u = (int)(inputs[5]); } int n_v = default(int); if (inputs[6] != null) { n_v = (int)(inputs[6]); } bool zbool = default(bool); if (inputs[7] != null) { zbool = (bool)(inputs[7]); } //3. Declare output parameters object P = null; object LP = null; object PP = null; object PL = null; object lines = null; object ends = null; object connect = null; object brep = null; object M = null; object F = null; object U = null; object V = null; //4. Invoke RunScript RunScript(lines_in, tolerance, width, deviation, angle, n_u, n_v, zbool, ref P, ref LP, ref PP, ref PL, ref lines, ref ends, ref connect, ref brep, ref M, ref F, ref U, ref V); try { //5. Assign output parameters to component... if (P != null) { if (GH_Format.TreatAsCollection(P)) { IEnumerable __enum_P = (IEnumerable)(P); DA.SetDataList(1, __enum_P); } else { if (P is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(1, (Grasshopper.Kernel.Data.IGH_DataTree)(P)); } else { //assign direct DA.SetData(1, P); } } } else { DA.SetData(1, null); } if (LP != null) { if (GH_Format.TreatAsCollection(LP)) { IEnumerable __enum_LP = (IEnumerable)(LP); DA.SetDataList(2, __enum_LP); } else { if (LP is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(2, (Grasshopper.Kernel.Data.IGH_DataTree)(LP)); } else { //assign direct DA.SetData(2, LP); } } } else { DA.SetData(2, null); } if (PP != null) { if (GH_Format.TreatAsCollection(PP)) { IEnumerable __enum_PP = (IEnumerable)(PP); DA.SetDataList(3, __enum_PP); } else { if (PP is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(3, (Grasshopper.Kernel.Data.IGH_DataTree)(PP)); } else { //assign direct DA.SetData(3, PP); } } } else { DA.SetData(3, null); } if (PL != null) { if (GH_Format.TreatAsCollection(PL)) { IEnumerable __enum_PL = (IEnumerable)(PL); DA.SetDataList(4, __enum_PL); } else { if (PL is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(4, (Grasshopper.Kernel.Data.IGH_DataTree)(PL)); } else { //assign direct DA.SetData(4, PL); } } } else { DA.SetData(4, null); } if (lines != null) { if (GH_Format.TreatAsCollection(lines)) { IEnumerable __enum_lines = (IEnumerable)(lines); DA.SetDataList(5, __enum_lines); } else { if (lines is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(5, (Grasshopper.Kernel.Data.IGH_DataTree)(lines)); } else { //assign direct DA.SetData(5, lines); } } } else { DA.SetData(5, null); } if (ends != null) { if (GH_Format.TreatAsCollection(ends)) { IEnumerable __enum_ends = (IEnumerable)(ends); DA.SetDataList(6, __enum_ends); } else { if (ends is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(6, (Grasshopper.Kernel.Data.IGH_DataTree)(ends)); } else { //assign direct DA.SetData(6, ends); } } } else { DA.SetData(6, null); } if (connect != null) { if (GH_Format.TreatAsCollection(connect)) { IEnumerable __enum_connect = (IEnumerable)(connect); DA.SetDataList(7, __enum_connect); } else { if (connect is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(7, (Grasshopper.Kernel.Data.IGH_DataTree)(connect)); } else { //assign direct DA.SetData(7, connect); } } } else { DA.SetData(7, null); } if (brep != null) { if (GH_Format.TreatAsCollection(brep)) { IEnumerable __enum_brep = (IEnumerable)(brep); DA.SetDataList(8, __enum_brep); } else { if (brep is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(8, (Grasshopper.Kernel.Data.IGH_DataTree)(brep)); } else { //assign direct DA.SetData(8, brep); } } } else { DA.SetData(8, null); } if (M != null) { if (GH_Format.TreatAsCollection(M)) { IEnumerable __enum_M = (IEnumerable)(M); DA.SetDataList(9, __enum_M); } else { if (M is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(9, (Grasshopper.Kernel.Data.IGH_DataTree)(M)); } else { //assign direct DA.SetData(9, M); } } } else { DA.SetData(9, null); } if (F != null) { if (GH_Format.TreatAsCollection(F)) { IEnumerable __enum_F = (IEnumerable)(F); DA.SetDataList(10, __enum_F); } else { if (F is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(10, (Grasshopper.Kernel.Data.IGH_DataTree)(F)); } else { //assign direct DA.SetData(10, F); } } } else { DA.SetData(10, null); } if (U != null) { if (GH_Format.TreatAsCollection(U)) { IEnumerable __enum_U = (IEnumerable)(U); DA.SetDataList(11, __enum_U); } else { if (U is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(11, (Grasshopper.Kernel.Data.IGH_DataTree)(U)); } else { //assign direct DA.SetData(11, U); } } } else { DA.SetData(11, null); } if (V != null) { if (GH_Format.TreatAsCollection(V)) { IEnumerable __enum_V = (IEnumerable)(V); DA.SetDataList(12, __enum_V); } else { if (V is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(12, (Grasshopper.Kernel.Data.IGH_DataTree)(V)); } else { //assign direct DA.SetData(12, V); } } } else { DA.SetData(12, null); } } catch (Exception ex) { this.__err.Add(string.Format("Script exception: {0}", ex.Message)); } finally { //Add errors and messages... if (owner.Params.Output.Count > 0) { if (owner.Params.Output[0] is Grasshopper.Kernel.Parameters.Param_String) { List <string> __errors_plus_messages = new List <string>(); if (this.__err != null) { __errors_plus_messages.AddRange(this.__err); } if (this.__out != null) { __errors_plus_messages.AddRange(this.__out); } if (__errors_plus_messages.Count > 0) { DA.SetDataList(0, __errors_plus_messages); } } } } }
private int runCount; //Legacy field. public override void InvokeRunScript(IGH_Component owner, object rhinoDocument, int iteration, List <object> inputs, IGH_DataAccess DA) { //Prepare for a new run... //1. Reset lists this.__out.Clear(); this.__err.Clear(); this.Component = owner; this.Iteration = iteration; this.GrasshopperDocument = owner.OnPingDocument(); this.RhinoDocument = rhinoDocument as Rhino.RhinoDoc; this.owner = this.Component; this.runCount = this.Iteration; this.doc = this.RhinoDocument; //2. Assign input parameters Brep Cube = default(Brep); if (inputs[0] != null) { Cube = (Brep)(inputs[0]); } Curve Crv = default(Curve); if (inputs[1] != null) { Crv = (Curve)(inputs[1]); } int Seed = default(int); if (inputs[2] != null) { Seed = (int)(inputs[2]); } double SubdivDist = default(double); if (inputs[3] != null) { SubdivDist = (double)(inputs[3]); } double SubdivRandomRate = default(double); if (inputs[4] != null) { SubdivRandomRate = (double)(inputs[4]); } double ReduceDist = default(double); if (inputs[5] != null) { ReduceDist = (double)(inputs[5]); } double ReduceRandomRate = default(double); if (inputs[6] != null) { ReduceRandomRate = (double)(inputs[6]); } int Loops = default(int); if (inputs[7] != null) { Loops = (int)(inputs[7]); } //3. Declare output parameters object result = null; //4. Invoke RunScript RunScript(Cube, Crv, Seed, SubdivDist, SubdivRandomRate, ReduceDist, ReduceRandomRate, Loops, ref result); try { //5. Assign output parameters to component... if (result != null) { if (GH_Format.TreatAsCollection(result)) { IEnumerable __enum_result = (IEnumerable)(result); DA.SetDataList(1, __enum_result); } else { if (result is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(1, (Grasshopper.Kernel.Data.IGH_DataTree)(result)); } else { //assign direct DA.SetData(1, result); } } } else { DA.SetData(1, null); } } catch (Exception ex) { this.__err.Add(string.Format("Script exception: {0}", ex.Message)); } finally { //Add errors and messages... if (owner.Params.Output.Count > 0) { if (owner.Params.Output[0] is Grasshopper.Kernel.Parameters.Param_String) { List <string> __errors_plus_messages = new List <string>(); if (this.__err != null) { __errors_plus_messages.AddRange(this.__err); } if (this.__out != null) { __errors_plus_messages.AddRange(this.__out); } if (__errors_plus_messages.Count > 0) { DA.SetDataList(0, __errors_plus_messages); } } } } }
private int runCount; //Legacy field. public override void InvokeRunScript(IGH_Component owner, object rhinoDocument, int iteration, List <object> inputs, IGH_DataAccess DA) { //Prepare for a new run... //1. Reset lists this.__out.Clear(); this.__err.Clear(); this.Component = owner; this.Iteration = iteration; this.GrasshopperDocument = owner.OnPingDocument(); this.RhinoDocument = rhinoDocument as Rhino.RhinoDoc; this.owner = this.Component; this.runCount = this.Iteration; this.doc = this.RhinoDocument; //2. Assign input parameters List <Surface> Blocks = null; if (inputs[0] != null) { Blocks = GH_DirtyCaster.CastToList <Surface>(inputs[0]); } List <double> FAR = null; if (inputs[1] != null) { FAR = GH_DirtyCaster.CastToList <double>(inputs[1]); } double BSR1 = default(double); if (inputs[2] != null) { BSR1 = (double)(inputs[2]); } double BSR2 = default(double); if (inputs[3] != null) { BSR2 = (double)(inputs[3]); } double BSR3 = default(double); if (inputs[4] != null) { BSR3 = (double)(inputs[4]); } List <Curve> RdA = null; if (inputs[5] != null) { RdA = GH_DirtyCaster.CastToList <Curve>(inputs[5]); } List <Curve> RdB = null; if (inputs[6] != null) { RdB = GH_DirtyCaster.CastToList <Curve>(inputs[6]); } double TRatio = default(double); if (inputs[7] != null) { TRatio = (double)(inputs[7]); } //3. Declare output parameters object TowerP = null; object TowerS = null; object Outline = null; object Buildings = null; object Yard = null; //4. Invoke RunScript RunScript(Blocks, FAR, BSR1, BSR2, BSR3, RdA, RdB, TRatio, ref TowerP, ref TowerS, ref Outline, ref Buildings, ref Yard); try { //5. Assign output parameters to component... if (TowerP != null) { if (GH_Format.TreatAsCollection(TowerP)) { IEnumerable __enum_TowerP = (IEnumerable)(TowerP); DA.SetDataList(1, __enum_TowerP); } else { if (TowerP is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(1, (Grasshopper.Kernel.Data.IGH_DataTree)(TowerP)); } else { //assign direct DA.SetData(1, TowerP); } } } else { DA.SetData(1, null); } if (TowerS != null) { if (GH_Format.TreatAsCollection(TowerS)) { IEnumerable __enum_TowerS = (IEnumerable)(TowerS); DA.SetDataList(2, __enum_TowerS); } else { if (TowerS is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(2, (Grasshopper.Kernel.Data.IGH_DataTree)(TowerS)); } else { //assign direct DA.SetData(2, TowerS); } } } else { DA.SetData(2, null); } if (Outline != null) { if (GH_Format.TreatAsCollection(Outline)) { IEnumerable __enum_Outline = (IEnumerable)(Outline); DA.SetDataList(3, __enum_Outline); } else { if (Outline is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(3, (Grasshopper.Kernel.Data.IGH_DataTree)(Outline)); } else { //assign direct DA.SetData(3, Outline); } } } else { DA.SetData(3, null); } if (Buildings != null) { if (GH_Format.TreatAsCollection(Buildings)) { IEnumerable __enum_Buildings = (IEnumerable)(Buildings); DA.SetDataList(4, __enum_Buildings); } else { if (Buildings is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(4, (Grasshopper.Kernel.Data.IGH_DataTree)(Buildings)); } else { //assign direct DA.SetData(4, Buildings); } } } else { DA.SetData(4, null); } if (Yard != null) { if (GH_Format.TreatAsCollection(Yard)) { IEnumerable __enum_Yard = (IEnumerable)(Yard); DA.SetDataList(5, __enum_Yard); } else { if (Yard is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(5, (Grasshopper.Kernel.Data.IGH_DataTree)(Yard)); } else { //assign direct DA.SetData(5, Yard); } } } else { DA.SetData(5, null); } } catch (Exception ex) { this.__err.Add(string.Format("Script exception: {0}", ex.Message)); } finally { //Add errors and messages... if (owner.Params.Output.Count > 0) { if (owner.Params.Output[0] is Grasshopper.Kernel.Parameters.Param_String) { List <string> __errors_plus_messages = new List <string>(); if (this.__err != null) { __errors_plus_messages.AddRange(this.__err); } if (this.__out != null) { __errors_plus_messages.AddRange(this.__out); } if (__errors_plus_messages.Count > 0) { DA.SetDataList(0, __errors_plus_messages); } } } } }
private int runCount; //Legacy field. public override void InvokeRunScript(IGH_Component owner, object rhinoDocument, int iteration, List <object> inputs, IGH_DataAccess DA) { //Prepare for a new run... //1. Reset lists this.__out.Clear(); this.__err.Clear(); this.Component = owner; this.Iteration = iteration; this.GrasshopperDocument = owner.OnPingDocument(); this.RhinoDocument = rhinoDocument as Rhino.RhinoDoc; this.owner = this.Component; this.runCount = this.Iteration; this.doc = this.RhinoDocument; //2. Assign input parameters List <Brep> subS = null; if (inputs[0] != null) { subS = GH_DirtyCaster.CastToList <Brep>(inputs[0]); } List <Line> RdA = null; if (inputs[1] != null) { RdA = GH_DirtyCaster.CastToList <Line>(inputs[1]); } List <Line> RdB = null; if (inputs[2] != null) { RdB = GH_DirtyCaster.CastToList <Line>(inputs[2]); } List <Line> RdC = null; if (inputs[3] != null) { RdC = GH_DirtyCaster.CastToList <Line>(inputs[3]); } List <int> ClsA = null; if (inputs[4] != null) { ClsA = GH_DirtyCaster.CastToList <int>(inputs[4]); } List <int> ClsB = null; if (inputs[5] != null) { ClsB = GH_DirtyCaster.CastToList <int>(inputs[5]); } List <int> ClsC = null; if (inputs[6] != null) { ClsC = GH_DirtyCaster.CastToList <int>(inputs[6]); } List <double> Wgt = null; if (inputs[7] != null) { Wgt = GH_DirtyCaster.CastToList <double>(inputs[7]); } List <double> HtA = null; if (inputs[8] != null) { HtA = GH_DirtyCaster.CastToList <double>(inputs[8]); } List <double> HtB = null; if (inputs[9] != null) { HtB = GH_DirtyCaster.CastToList <double>(inputs[9]); } List <double> HtC = null; if (inputs[10] != null) { HtC = GH_DirtyCaster.CastToList <double>(inputs[10]); } bool TrgA = default(bool); if (inputs[11] != null) { TrgA = (bool)(inputs[11]); } bool TrgB = default(bool); if (inputs[12] != null) { TrgB = (bool)(inputs[12]); } bool TrgC = default(bool); if (inputs[13] != null) { TrgC = (bool)(inputs[13]); } //3. Declare output parameters object Block = null; object Density = null; //4. Invoke RunScript RunScript(subS, RdA, RdB, RdC, ClsA, ClsB, ClsC, Wgt, HtA, HtB, HtC, TrgA, TrgB, TrgC, ref Block, ref Density); try { //5. Assign output parameters to component... if (Block != null) { if (GH_Format.TreatAsCollection(Block)) { IEnumerable __enum_Block = (IEnumerable)(Block); DA.SetDataList(1, __enum_Block); } else { if (Block is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(1, (Grasshopper.Kernel.Data.IGH_DataTree)(Block)); } else { //assign direct DA.SetData(1, Block); } } } else { DA.SetData(1, null); } if (Density != null) { if (GH_Format.TreatAsCollection(Density)) { IEnumerable __enum_Density = (IEnumerable)(Density); DA.SetDataList(2, __enum_Density); } else { if (Density is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(2, (Grasshopper.Kernel.Data.IGH_DataTree)(Density)); } else { //assign direct DA.SetData(2, Density); } } } else { DA.SetData(2, null); } } catch (Exception ex) { this.__err.Add(string.Format("Script exception: {0}", ex.Message)); } finally { //Add errors and messages... if (owner.Params.Output.Count > 0) { if (owner.Params.Output[0] is Grasshopper.Kernel.Parameters.Param_String) { List <string> __errors_plus_messages = new List <string>(); if (this.__err != null) { __errors_plus_messages.AddRange(this.__err); } if (this.__out != null) { __errors_plus_messages.AddRange(this.__out); } if (__errors_plus_messages.Count > 0) { DA.SetDataList(0, __errors_plus_messages); } } } } }
private int runCount; //Legacy field. public override void InvokeRunScript(IGH_Component owner, object rhinoDocument, int iteration, List <object> inputs, IGH_DataAccess DA) { //Prepare for a new run... //1. Reset lists this.__out.Clear(); this.__err.Clear(); this.Component = owner; this.Iteration = iteration; this.GrasshopperDocument = owner.OnPingDocument(); this.RhinoDocument = rhinoDocument as Rhino.RhinoDoc; this.owner = this.Component; this.runCount = this.Iteration; this.doc = this.RhinoDocument; //2. Assign input parameters List <Point3d> P = null; if (inputs[0] != null) { P = GH_DirtyCaster.CastToList <Point3d>(inputs[0]); } Mesh M = default(Mesh); if (inputs[1] != null) { M = (Mesh)(inputs[1]); } double step = default(double); if (inputs[2] != null) { step = (double)(inputs[2]); } bool reset = default(bool); if (inputs[3] != null) { reset = (bool)(inputs[3]); } bool go = default(bool); if (inputs[4] != null) { go = (bool)(inputs[4]); } //3. Declare output parameters object Pos = null; object status = null; object Trails = null; //4. Invoke RunScript RunScript(P, M, step, reset, go, ref Pos, ref status, ref Trails); try { //5. Assign output parameters to component... if (Pos != null) { if (GH_Format.TreatAsCollection(Pos)) { IEnumerable __enum_Pos = (IEnumerable)(Pos); DA.SetDataList(1, __enum_Pos); } else { if (Pos is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(1, (Grasshopper.Kernel.Data.IGH_DataTree)(Pos)); } else { //assign direct DA.SetData(1, Pos); } } } else { DA.SetData(1, null); } if (status != null) { if (GH_Format.TreatAsCollection(status)) { IEnumerable __enum_status = (IEnumerable)(status); DA.SetDataList(2, __enum_status); } else { if (status is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(2, (Grasshopper.Kernel.Data.IGH_DataTree)(status)); } else { //assign direct DA.SetData(2, status); } } } else { DA.SetData(2, null); } if (Trails != null) { if (GH_Format.TreatAsCollection(Trails)) { IEnumerable __enum_Trails = (IEnumerable)(Trails); DA.SetDataList(3, __enum_Trails); } else { if (Trails is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(3, (Grasshopper.Kernel.Data.IGH_DataTree)(Trails)); } else { //assign direct DA.SetData(3, Trails); } } } else { DA.SetData(3, null); } } catch (Exception ex) { this.__err.Add(string.Format("Script exception: {0}", ex.Message)); } finally { //Add errors and messages... if (owner.Params.Output.Count > 0) { if (owner.Params.Output[0] is Grasshopper.Kernel.Parameters.Param_String) { List <string> __errors_plus_messages = new List <string>(); if (this.__err != null) { __errors_plus_messages.AddRange(this.__err); } if (this.__out != null) { __errors_plus_messages.AddRange(this.__out); } if (__errors_plus_messages.Count > 0) { DA.SetDataList(0, __errors_plus_messages); } } } } }
private int runCount; //Legacy field. public override void InvokeRunScript(IGH_Component owner, object rhinoDocument, int iteration, List <object> inputs, IGH_DataAccess DA) { //Prepare for a new run... //1. Reset lists this.__out.Clear(); this.__err.Clear(); this.Component = owner; this.Iteration = iteration; this.GrasshopperDocument = owner.OnPingDocument(); this.RhinoDocument = rhinoDocument as Rhino.RhinoDoc; this.owner = this.Component; this.runCount = this.Iteration; this.doc = this.RhinoDocument; //2. Assign input parameters double x = default(double); if (inputs[0] != null) { x = (double)(inputs[0]); } int xCount = default(int); if (inputs[1] != null) { xCount = (int)(inputs[1]); } double xElimination = default(double); if (inputs[2] != null) { xElimination = (double)(inputs[2]); } double y = default(double); if (inputs[3] != null) { y = (double)(inputs[3]); } int yCount = default(int); if (inputs[4] != null) { yCount = (int)(inputs[4]); } double yElimination = default(double); if (inputs[5] != null) { yElimination = (double)(inputs[5]); } double z = default(double); if (inputs[6] != null) { z = (double)(inputs[6]); } int zCount = default(int); if (inputs[7] != null) { zCount = (int)(inputs[7]); } double zElimination = default(double); if (inputs[8] != null) { zElimination = (double)(inputs[8]); } object void0 = default(object); if (inputs[9] != null) { void0 = (object)(inputs[9]); } int rollTheBones = default(int); if (inputs[10] != null) { rollTheBones = (int)(inputs[10]); } int result = default(int); if (inputs[11] != null) { result = (int)(inputs[11]); } //3. Declare output parameters object Elapsed = null; object resultTree = null; //4. Invoke RunScript RunScript(x, xCount, xElimination, y, yCount, yElimination, z, zCount, zElimination, void0, rollTheBones, result, ref Elapsed, ref resultTree); try { //5. Assign output parameters to component... if (Elapsed != null) { if (GH_Format.TreatAsCollection(Elapsed)) { IEnumerable __enum_Elapsed = (IEnumerable)(Elapsed); DA.SetDataList(1, __enum_Elapsed); } else { if (Elapsed is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(1, (Grasshopper.Kernel.Data.IGH_DataTree)(Elapsed)); } else { //assign direct DA.SetData(1, Elapsed); } } } else { DA.SetData(1, null); } if (resultTree != null) { if (GH_Format.TreatAsCollection(resultTree)) { IEnumerable __enum_resultTree = (IEnumerable)(resultTree); DA.SetDataList(2, __enum_resultTree); } else { if (resultTree is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(2, (Grasshopper.Kernel.Data.IGH_DataTree)(resultTree)); } else { //assign direct DA.SetData(2, resultTree); } } } else { DA.SetData(2, null); } } catch (Exception ex) { this.__err.Add(string.Format("Script exception: {0}", ex.Message)); } finally { //Add errors and messages... if (owner.Params.Output.Count > 0) { if (owner.Params.Output[0] is Grasshopper.Kernel.Parameters.Param_String) { List <string> __errors_plus_messages = new List <string>(); if (this.__err != null) { __errors_plus_messages.AddRange(this.__err); } if (this.__out != null) { __errors_plus_messages.AddRange(this.__out); } if (__errors_plus_messages.Count > 0) { DA.SetDataList(0, __errors_plus_messages); } } } } }
private int runCount; //Legacy field. public override void InvokeRunScript(IGH_Component owner, object rhinoDocument, int iteration, List <object> inputs, IGH_DataAccess DA) { //Prepare for a new run... //1. Reset lists this.__out.Clear(); this.__err.Clear(); this.Component = owner; this.Iteration = iteration; this.GrasshopperDocument = owner.OnPingDocument(); this.RhinoDocument = rhinoDocument as Rhino.RhinoDoc; this.owner = this.Component; this.runCount = this.Iteration; this.doc = this.RhinoDocument; //2. Assign input parameters List <Brep> Blocks = null; if (inputs[0] != null) { Blocks = GH_DirtyCaster.CastToList <Brep>(inputs[0]); } Curve Boundary = default(Curve); if (inputs[1] != null) { Boundary = (Curve)(inputs[1]); } List <Line> RdA = null; if (inputs[2] != null) { RdA = GH_DirtyCaster.CastToList <Line>(inputs[2]); } double HalfWA = default(double); if (inputs[3] != null) { HalfWA = (double)(inputs[3]); } List <Line> RdB = null; if (inputs[4] != null) { RdB = GH_DirtyCaster.CastToList <Line>(inputs[4]); } double HalfWB = default(double); if (inputs[5] != null) { HalfWB = (double)(inputs[5]); } List <Line> RdC = null; if (inputs[6] != null) { RdC = GH_DirtyCaster.CastToList <Line>(inputs[6]); } double HalfWC = default(double); if (inputs[7] != null) { HalfWC = (double)(inputs[7]); } double PedOff = default(double); if (inputs[8] != null) { PedOff = (double)(inputs[8]); } //3. Declare output parameters object BuildingSetback = null; object PedestrianOutline = null; //4. Invoke RunScript RunScript(Blocks, Boundary, RdA, HalfWA, RdB, HalfWB, RdC, HalfWC, PedOff, ref BuildingSetback, ref PedestrianOutline); try { //5. Assign output parameters to component... if (BuildingSetback != null) { if (GH_Format.TreatAsCollection(BuildingSetback)) { IEnumerable __enum_BuildingSetback = (IEnumerable)(BuildingSetback); DA.SetDataList(1, __enum_BuildingSetback); } else { if (BuildingSetback is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(1, (Grasshopper.Kernel.Data.IGH_DataTree)(BuildingSetback)); } else { //assign direct DA.SetData(1, BuildingSetback); } } } else { DA.SetData(1, null); } if (PedestrianOutline != null) { if (GH_Format.TreatAsCollection(PedestrianOutline)) { IEnumerable __enum_PedestrianOutline = (IEnumerable)(PedestrianOutline); DA.SetDataList(2, __enum_PedestrianOutline); } else { if (PedestrianOutline is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(2, (Grasshopper.Kernel.Data.IGH_DataTree)(PedestrianOutline)); } else { //assign direct DA.SetData(2, PedestrianOutline); } } } else { DA.SetData(2, null); } } catch (Exception ex) { this.__err.Add(string.Format("Script exception: {0}", ex.Message)); } finally { //Add errors and messages... if (owner.Params.Output.Count > 0) { if (owner.Params.Output[0] is Grasshopper.Kernel.Parameters.Param_String) { List <string> __errors_plus_messages = new List <string>(); if (this.__err != null) { __errors_plus_messages.AddRange(this.__err); } if (this.__out != null) { __errors_plus_messages.AddRange(this.__out); } if (__errors_plus_messages.Count > 0) { DA.SetDataList(0, __errors_plus_messages); } } } } }
private int runCount; //Legacy field. public override void InvokeRunScript(IGH_Component owner, object rhinoDocument, int iteration, List <object> inputs, IGH_DataAccess DA) { //Prepare for a new run... //1. Reset lists this.__out.Clear(); this.__err.Clear(); this.Component = owner; this.Iteration = iteration; this.GrasshopperDocument = owner.OnPingDocument(); this.RhinoDocument = rhinoDocument as Rhino.RhinoDoc; this.owner = this.Component; this.runCount = this.Iteration; this.doc = this.RhinoDocument; //2. Assign input parameters Point3d P0 = default(Point3d); if (inputs[0] != null) { P0 = (Point3d)(inputs[0]); } int n = default(int); if (inputs[1] != null) { n = (int)(inputs[1]); } double evap = default(double); if (inputs[2] != null) { evap = (double)(inputs[2]); } bool wrap = default(bool); if (inputs[3] != null) { wrap = (bool)(inputs[3]); } bool reset = default(bool); if (inputs[4] != null) { reset = (bool)(inputs[4]); } bool go = default(bool); if (inputs[5] != null) { go = (bool)(inputs[5]); } bool MT = default(bool); if (inputs[6] != null) { MT = (bool)(inputs[6]); } //3. Declare output parameters object P = null; object cPind = null; object nIndexes = null; object S = null; //4. Invoke RunScript RunScript(P0, n, evap, wrap, reset, go, MT, ref P, ref cPind, ref nIndexes, ref S); try { //5. Assign output parameters to component... if (P != null) { if (GH_Format.TreatAsCollection(P)) { IEnumerable __enum_P = (IEnumerable)(P); DA.SetDataList(1, __enum_P); } else { if (P is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(1, (Grasshopper.Kernel.Data.IGH_DataTree)(P)); } else { //assign direct DA.SetData(1, P); } } } else { DA.SetData(1, null); } if (cPind != null) { if (GH_Format.TreatAsCollection(cPind)) { IEnumerable __enum_cPind = (IEnumerable)(cPind); DA.SetDataList(2, __enum_cPind); } else { if (cPind is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(2, (Grasshopper.Kernel.Data.IGH_DataTree)(cPind)); } else { //assign direct DA.SetData(2, cPind); } } } else { DA.SetData(2, null); } if (nIndexes != null) { if (GH_Format.TreatAsCollection(nIndexes)) { IEnumerable __enum_nIndexes = (IEnumerable)(nIndexes); DA.SetDataList(3, __enum_nIndexes); } else { if (nIndexes is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(3, (Grasshopper.Kernel.Data.IGH_DataTree)(nIndexes)); } else { //assign direct DA.SetData(3, nIndexes); } } } else { DA.SetData(3, null); } if (S != null) { if (GH_Format.TreatAsCollection(S)) { IEnumerable __enum_S = (IEnumerable)(S); DA.SetDataList(4, __enum_S); } else { if (S is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(4, (Grasshopper.Kernel.Data.IGH_DataTree)(S)); } else { //assign direct DA.SetData(4, S); } } } else { DA.SetData(4, null); } } catch (Exception ex) { this.__err.Add(string.Format("Script exception: {0}", ex.Message)); } finally { //Add errors and messages... if (owner.Params.Output.Count > 0) { if (owner.Params.Output[0] is Grasshopper.Kernel.Parameters.Param_String) { List <string> __errors_plus_messages = new List <string>(); if (this.__err != null) { __errors_plus_messages.AddRange(this.__err); } if (this.__out != null) { __errors_plus_messages.AddRange(this.__out); } if (__errors_plus_messages.Count > 0) { DA.SetDataList(0, __errors_plus_messages); } } } } }
private int runCount; //Legacy field. public override void InvokeRunScript(IGH_Component owner, object rhinoDocument, int iteration, List <object> inputs, IGH_DataAccess DA) { //Prepare for a new run... //1. Reset lists this.__out.Clear(); this.__err.Clear(); this.Component = owner; this.Iteration = iteration; this.GrasshopperDocument = owner.OnPingDocument(); this.RhinoDocument = rhinoDocument as Rhino.RhinoDoc; this.owner = this.Component; this.runCount = this.Iteration; this.doc = this.RhinoDocument; //2. Assign input parameters List <Point3d> P = null; if (inputs[0] != null) { P = GH_DirtyCaster.CastToList <Point3d>(inputs[0]); } List <Vector3d> V = null; if (inputs[1] != null) { V = GH_DirtyCaster.CastToList <Vector3d>(inputs[1]); } List <Vector3d> vF = null; if (inputs[2] != null) { vF = GH_DirtyCaster.CastToList <Vector3d>(inputs[2]); } double pR = default(double); if (inputs[3] != null) { pR = (double)(inputs[3]); } double cI = default(double); if (inputs[4] != null) { cI = (double)(inputs[4]); } double aI = default(double); if (inputs[5] != null) { aI = (double)(inputs[5]); } double sI = default(double); if (inputs[6] != null) { sI = (double)(inputs[6]); } object fI = default(object); if (inputs[7] != null) { fI = (object)(inputs[7]); } double mF = default(double); if (inputs[8] != null) { mF = (double)(inputs[8]); } //3. Declare output parameters object Planes = null; //4. Invoke RunScript RunScript(P, V, vF, pR, cI, aI, sI, fI, mF, ref Planes); try { //5. Assign output parameters to component... if (Planes != null) { if (GH_Format.TreatAsCollection(Planes)) { IEnumerable __enum_Planes = (IEnumerable)(Planes); DA.SetDataList(1, __enum_Planes); } else { if (Planes is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(1, (Grasshopper.Kernel.Data.IGH_DataTree)(Planes)); } else { //assign direct DA.SetData(1, Planes); } } } else { DA.SetData(1, null); } } catch (Exception ex) { this.__err.Add(string.Format("Script exception: {0}", ex.Message)); } finally { //Add errors and messages... if (owner.Params.Output.Count > 0) { if (owner.Params.Output[0] is Grasshopper.Kernel.Parameters.Param_String) { List <string> __errors_plus_messages = new List <string>(); if (this.__err != null) { __errors_plus_messages.AddRange(this.__err); } if (this.__out != null) { __errors_plus_messages.AddRange(this.__out); } if (__errors_plus_messages.Count > 0) { DA.SetDataList(0, __errors_plus_messages); } } } } }
private int runCount; //Legacy field. public override void InvokeRunScript(IGH_Component owner, object rhinoDocument, int iteration, List <object> inputs, IGH_DataAccess DA) { //Prepare for a new run... //1. Reset lists this.__out.Clear(); this.__err.Clear(); this.Component = owner; this.Iteration = iteration; this.GrasshopperDocument = owner.OnPingDocument(); this.RhinoDocument = rhinoDocument as Rhino.RhinoDoc; this.owner = this.Component; this.runCount = this.Iteration; this.doc = this.RhinoDocument; //2. Assign input parameters DataTree <Curve> cTree = null; if (inputs[0] != null) { cTree = GH_DirtyCaster.CastToTree <Curve>(inputs[0]); } DataTree <double> oTree = null; if (inputs[1] != null) { oTree = GH_DirtyCaster.CastToTree <double>(inputs[1]); } double angleThreshold = default(double); if (inputs[2] != null) { angleThreshold = (double)(inputs[2]); } //3. Declare output parameters object crvs = null; object crvs2 = null; object pts = null; object perps = null; //4. Invoke RunScript RunScript(cTree, oTree, angleThreshold, ref crvs, ref crvs2, ref pts, ref perps); try { //5. Assign output parameters to component... if (crvs != null) { if (GH_Format.TreatAsCollection(crvs)) { IEnumerable __enum_crvs = (IEnumerable)(crvs); DA.SetDataList(1, __enum_crvs); } else { if (crvs is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(1, (Grasshopper.Kernel.Data.IGH_DataTree)(crvs)); } else { //assign direct DA.SetData(1, crvs); } } } else { DA.SetData(1, null); } if (crvs2 != null) { if (GH_Format.TreatAsCollection(crvs2)) { IEnumerable __enum_crvs2 = (IEnumerable)(crvs2); DA.SetDataList(2, __enum_crvs2); } else { if (crvs2 is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(2, (Grasshopper.Kernel.Data.IGH_DataTree)(crvs2)); } else { //assign direct DA.SetData(2, crvs2); } } } else { DA.SetData(2, null); } if (pts != null) { if (GH_Format.TreatAsCollection(pts)) { IEnumerable __enum_pts = (IEnumerable)(pts); DA.SetDataList(3, __enum_pts); } else { if (pts is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(3, (Grasshopper.Kernel.Data.IGH_DataTree)(pts)); } else { //assign direct DA.SetData(3, pts); } } } else { DA.SetData(3, null); } if (perps != null) { if (GH_Format.TreatAsCollection(perps)) { IEnumerable __enum_perps = (IEnumerable)(perps); DA.SetDataList(4, __enum_perps); } else { if (perps is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(4, (Grasshopper.Kernel.Data.IGH_DataTree)(perps)); } else { //assign direct DA.SetData(4, perps); } } } else { DA.SetData(4, null); } } catch (Exception ex) { this.__err.Add(string.Format("Script exception: {0}", ex.Message)); } finally { //Add errors and messages... if (owner.Params.Output.Count > 0) { if (owner.Params.Output[0] is Grasshopper.Kernel.Parameters.Param_String) { List <string> __errors_plus_messages = new List <string>(); if (this.__err != null) { __errors_plus_messages.AddRange(this.__err); } if (this.__out != null) { __errors_plus_messages.AddRange(this.__out); } if (__errors_plus_messages.Count > 0) { DA.SetDataList(0, __errors_plus_messages); } } } } }
private int runCount; //Legacy field. public override void InvokeRunScript(IGH_Component owner, object rhinoDocument, int iteration, List <object> inputs, IGH_DataAccess DA) { //Prepare for a new run... //1. Reset lists this.__out.Clear(); this.__err.Clear(); this.Component = owner; this.Iteration = iteration; this.GrasshopperDocument = owner.OnPingDocument(); this.RhinoDocument = rhinoDocument as Rhino.RhinoDoc; this.owner = this.Component; this.runCount = this.Iteration; this.doc = this.RhinoDocument; //2. Assign input parameters Brep brep = default(Brep); if (inputs[0] != null) { brep = (Brep)(inputs[0]); } object void0 = default(object); if (inputs[1] != null) { void0 = (object)(inputs[1]); } int fate = default(int); if (inputs[2] != null) { fate = (int)(inputs[2]); } int mode = default(int); if (inputs[3] != null) { mode = (int)(inputs[3]); } double rot = default(double); if (inputs[4] != null) { rot = (double)(inputs[4]); } object void1 = default(object); if (inputs[5] != null) { void1 = (object)(inputs[5]); } int divX = default(int); if (inputs[6] != null) { divX = (int)(inputs[6]); } int divY = default(int); if (inputs[7] != null) { divY = (int)(inputs[7]); } double stepZ = default(double); if (inputs[8] != null) { stepZ = (double)(inputs[8]); } int inX = default(int); if (inputs[9] != null) { inX = (int)(inputs[9]); } int inY = default(int); if (inputs[10] != null) { inY = (int)(inputs[10]); } //3. Declare output parameters object DucatiumPanigaleumAmamusDumSpiramus = null; object Elapsed = null; object baseBoxWire = null; object baseGrid = null; object baseColumns = null; object xStruts = null; object yStruts = null; //4. Invoke RunScript RunScript(brep, void0, fate, mode, rot, void1, divX, divY, stepZ, inX, inY, ref DucatiumPanigaleumAmamusDumSpiramus, ref Elapsed, ref baseBoxWire, ref baseGrid, ref baseColumns, ref xStruts, ref yStruts); try { //5. Assign output parameters to component... if (DucatiumPanigaleumAmamusDumSpiramus != null) { if (GH_Format.TreatAsCollection(DucatiumPanigaleumAmamusDumSpiramus)) { IEnumerable __enum_DucatiumPanigaleumAmamusDumSpiramus = (IEnumerable)(DucatiumPanigaleumAmamusDumSpiramus); DA.SetDataList(1, __enum_DucatiumPanigaleumAmamusDumSpiramus); } else { if (DucatiumPanigaleumAmamusDumSpiramus is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(1, (Grasshopper.Kernel.Data.IGH_DataTree)(DucatiumPanigaleumAmamusDumSpiramus)); } else { //assign direct DA.SetData(1, DucatiumPanigaleumAmamusDumSpiramus); } } } else { DA.SetData(1, null); } if (Elapsed != null) { if (GH_Format.TreatAsCollection(Elapsed)) { IEnumerable __enum_Elapsed = (IEnumerable)(Elapsed); DA.SetDataList(2, __enum_Elapsed); } else { if (Elapsed is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(2, (Grasshopper.Kernel.Data.IGH_DataTree)(Elapsed)); } else { //assign direct DA.SetData(2, Elapsed); } } } else { DA.SetData(2, null); } if (baseBoxWire != null) { if (GH_Format.TreatAsCollection(baseBoxWire)) { IEnumerable __enum_baseBoxWire = (IEnumerable)(baseBoxWire); DA.SetDataList(3, __enum_baseBoxWire); } else { if (baseBoxWire is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(3, (Grasshopper.Kernel.Data.IGH_DataTree)(baseBoxWire)); } else { //assign direct DA.SetData(3, baseBoxWire); } } } else { DA.SetData(3, null); } if (baseGrid != null) { if (GH_Format.TreatAsCollection(baseGrid)) { IEnumerable __enum_baseGrid = (IEnumerable)(baseGrid); DA.SetDataList(4, __enum_baseGrid); } else { if (baseGrid is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(4, (Grasshopper.Kernel.Data.IGH_DataTree)(baseGrid)); } else { //assign direct DA.SetData(4, baseGrid); } } } else { DA.SetData(4, null); } if (baseColumns != null) { if (GH_Format.TreatAsCollection(baseColumns)) { IEnumerable __enum_baseColumns = (IEnumerable)(baseColumns); DA.SetDataList(5, __enum_baseColumns); } else { if (baseColumns is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(5, (Grasshopper.Kernel.Data.IGH_DataTree)(baseColumns)); } else { //assign direct DA.SetData(5, baseColumns); } } } else { DA.SetData(5, null); } if (xStruts != null) { if (GH_Format.TreatAsCollection(xStruts)) { IEnumerable __enum_xStruts = (IEnumerable)(xStruts); DA.SetDataList(6, __enum_xStruts); } else { if (xStruts is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(6, (Grasshopper.Kernel.Data.IGH_DataTree)(xStruts)); } else { //assign direct DA.SetData(6, xStruts); } } } else { DA.SetData(6, null); } if (yStruts != null) { if (GH_Format.TreatAsCollection(yStruts)) { IEnumerable __enum_yStruts = (IEnumerable)(yStruts); DA.SetDataList(7, __enum_yStruts); } else { if (yStruts is Grasshopper.Kernel.Data.IGH_DataTree) { //merge tree DA.SetDataTree(7, (Grasshopper.Kernel.Data.IGH_DataTree)(yStruts)); } else { //assign direct DA.SetData(7, yStruts); } } } else { DA.SetData(7, null); } } catch (Exception ex) { this.__err.Add(string.Format("Script exception: {0}", ex.Message)); } finally { //Add errors and messages... if (owner.Params.Output.Count > 0) { if (owner.Params.Output[0] is Grasshopper.Kernel.Parameters.Param_String) { List <string> __errors_plus_messages = new List <string>(); if (this.__err != null) { __errors_plus_messages.AddRange(this.__err); } if (this.__out != null) { __errors_plus_messages.AddRange(this.__out); } if (__errors_plus_messages.Count > 0) { DA.SetDataList(0, __errors_plus_messages); } } } } }