Exemplo n.º 1
0
        public override string ToString()
        {
            if (!IsValid)
            {
                return($"Invalid {TypeName}");
            }

            if (Value.HasTexture)
            {
                return($"{Value.TextureValue}");
            }
            else
            {
                return(GH_Format.FormatColour((System.Drawing.Color)Value.ToColorRGBA()));
            }
        }
Exemplo n.º 2
0
    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 freq = default(double);

        if (inputs[2] != null)
        {
            freq = (double)(inputs[2]);
        }

        double amp = default(double);

        if (inputs[3] != null)
        {
            amp = (double)(inputs[3]);
        }

        double speed = default(double);

        if (inputs[4] != null)
        {
            speed = (double)(inputs[4]);
        }

        bool reset = default(bool);

        if (inputs[5] != null)
        {
            reset = (bool)(inputs[5]);
        }

        bool go = default(bool);

        if (inputs[6] != null)
        {
            go = (bool)(inputs[6]);
        }

        bool GHType = default(bool);

        if (inputs[7] != null)
        {
            GHType = (bool)(inputs[7]);
        }



        //3. Declare output parameters
        object P = null;


        //4. Invoke RunScript
        RunScript(P0, n, freq, amp, speed, reset, go, GHType, 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);
                    }
                }
            }
        }
    }
Exemplo n.º 3
0
    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);
                    }
                }
            }
        }
    }
Exemplo n.º 4
0
    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 nX = default(int);

        if (inputs[0] != null)
        {
            nX = (int)(inputs[0]);
        }

        double nY = default(double);

        if (inputs[1] != null)
        {
            nY = (double)(inputs[1]);
        }

        double step = default(double);

        if (inputs[2] != null)
        {
            step = (double)(inputs[2]);
        }

        Point3d att = default(Point3d);

        if (inputs[3] != null)
        {
            att = (Point3d)(inputs[3]);
        }

        double rA = default(double);

        if (inputs[4] != null)
        {
            rA = (double)(inputs[4]);
        }

        double rB = default(double);

        if (inputs[5] != null)
        {
            rB = (double)(inputs[5]);
        }

        double thres = default(double);

        if (inputs[6] != null)
        {
            thres = (double)(inputs[6]);
        }

        bool map = default(bool);

        if (inputs[7] != null)
        {
            map = (bool)(inputs[7]);
        }



        //3. Declare output parameters
        object C = null;


        //4. Invoke RunScript
        RunScript(nX, nY, step, att, rA, rB, thres, map, ref C);

        try
        {
            //5. Assign output parameters to component...
            if (C != null)
            {
                if (GH_Format.TreatAsCollection(C))
                {
                    IEnumerable __enum_C = (IEnumerable)(C);
                    DA.SetDataList(1, __enum_C);
                }
                else
                {
                    if (C is Grasshopper.Kernel.Data.IGH_DataTree)
                    {
                        //merge tree
                        DA.SetDataTree(1, (Grasshopper.Kernel.Data.IGH_DataTree)(C));
                    }
                    else
                    {
                        //assign direct
                        DA.SetData(1, C);
                    }
                }
            }
            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);
                    }
                }
            }
        }
    }
Exemplo n.º 5
0
    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]);
        }

        List <string> S = null;

        if (inputs[1] != null)
        {
            S = GH_DirtyCaster.CastToList <string>(inputs[1]);
        }


        //3. Declare output parameters
        object A = null;
        object B = null;
        object C = null;
        object D = null;
        object E = null;
        object F = null;


        //4. Invoke RunScript
        RunScript(n, S, ref A, ref B, ref C, ref D, ref E, ref F);

        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);
            }
            if (E != null)
            {
                if (GH_Format.TreatAsCollection(E))
                {
                    IEnumerable __enum_E = (IEnumerable)(E);
                    DA.SetDataList(5, __enum_E);
                }
                else
                {
                    if (E is Grasshopper.Kernel.Data.IGH_DataTree)
                    {
                        //merge tree
                        DA.SetDataTree(5, (Grasshopper.Kernel.Data.IGH_DataTree)(E));
                    }
                    else
                    {
                        //assign direct
                        DA.SetData(5, E);
                    }
                }
            }
            else
            {
                DA.SetData(5, null);
            }
            if (F != null)
            {
                if (GH_Format.TreatAsCollection(F))
                {
                    IEnumerable __enum_F = (IEnumerable)(F);
                    DA.SetDataList(6, __enum_F);
                }
                else
                {
                    if (F is Grasshopper.Kernel.Data.IGH_DataTree)
                    {
                        //merge tree
                        DA.SetDataTree(6, (Grasshopper.Kernel.Data.IGH_DataTree)(F));
                    }
                    else
                    {
                        //assign direct
                        DA.SetData(6, F);
                    }
                }
            }
            else
            {
                DA.SetData(6, 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);
                    }
                }
            }
        }
    }
Exemplo n.º 6
0
    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
        bool reset = default(bool);

        if (inputs[0] != null)
        {
            reset = (bool)(inputs[0]);
        }

        string path = default(string);

        if (inputs[1] != null)
        {
            path = (string)(inputs[1]);
        }

        string controlComponentName = default(string);

        if (inputs[2] != null)
        {
            controlComponentName = (string)(inputs[2]);
        }



        //3. Declare output parameters
        object A = null;


        //4. Invoke RunScript
        RunScript(reset, path, controlComponentName, 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);
                    }
                }
            }
        }
    }
Exemplo n.º 7
0
    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
        Brep Bnd = default(Brep);

        if (inputs[0] != null)
        {
            Bnd = (Brep)(inputs[0]);
        }

        List <Curve> RdA = null;

        if (inputs[1] != null)
        {
            RdA = GH_DirtyCaster.CastToList <Curve>(inputs[1]);
        }
        int Crt1 = default(int);

        if (inputs[2] != null)
        {
            Crt1 = (int)(inputs[2]);
        }

        double AmpC1 = default(double);

        if (inputs[3] != null)
        {
            AmpC1 = (double)(inputs[3]);
        }

        int Dist1 = default(int);

        if (inputs[4] != null)
        {
            Dist1 = (int)(inputs[4]);
        }

        int Crt2 = default(int);

        if (inputs[5] != null)
        {
            Crt2 = (int)(inputs[5]);
        }

        double AmpC2 = default(double);

        if (inputs[6] != null)
        {
            AmpC2 = (double)(inputs[6]);
        }

        int Dist2 = default(int);

        if (inputs[7] != null)
        {
            Dist2 = (int)(inputs[7]);
        }

        double RndPara = default(double);

        if (inputs[8] != null)
        {
            RndPara = (double)(inputs[8]);
        }

        int CtnRng1 = default(int);

        if (inputs[9] != null)
        {
            CtnRng1 = (int)(inputs[9]);
        }

        int CtnRng2 = default(int);

        if (inputs[10] != null)
        {
            CtnRng2 = (int)(inputs[10]);
        }

        int LenRat = default(int);

        if (inputs[11] != null)
        {
            LenRat = (int)(inputs[11]);
        }

        int Sd = default(int);

        if (inputs[12] != null)
        {
            Sd = (int)(inputs[12]);
        }



        //3. Declare output parameters
        object BLOCKS = null;
        object RDA    = null;
        object RDB    = null;
        object RDC    = null;


        //4. Invoke RunScript
        RunScript(Bnd, RdA, Crt1, AmpC1, Dist1, Crt2, AmpC2, Dist2, RndPara, CtnRng1, CtnRng2, LenRat, Sd, ref BLOCKS, ref RDA, ref RDB, ref RDC);

        try
        {
            //5. Assign output parameters to component...
            if (BLOCKS != null)
            {
                if (GH_Format.TreatAsCollection(BLOCKS))
                {
                    IEnumerable __enum_BLOCKS = (IEnumerable)(BLOCKS);
                    DA.SetDataList(1, __enum_BLOCKS);
                }
                else
                {
                    if (BLOCKS is Grasshopper.Kernel.Data.IGH_DataTree)
                    {
                        //merge tree
                        DA.SetDataTree(1, (Grasshopper.Kernel.Data.IGH_DataTree)(BLOCKS));
                    }
                    else
                    {
                        //assign direct
                        DA.SetData(1, BLOCKS);
                    }
                }
            }
            else
            {
                DA.SetData(1, null);
            }
            if (RDA != null)
            {
                if (GH_Format.TreatAsCollection(RDA))
                {
                    IEnumerable __enum_RDA = (IEnumerable)(RDA);
                    DA.SetDataList(2, __enum_RDA);
                }
                else
                {
                    if (RDA is Grasshopper.Kernel.Data.IGH_DataTree)
                    {
                        //merge tree
                        DA.SetDataTree(2, (Grasshopper.Kernel.Data.IGH_DataTree)(RDA));
                    }
                    else
                    {
                        //assign direct
                        DA.SetData(2, RDA);
                    }
                }
            }
            else
            {
                DA.SetData(2, null);
            }
            if (RDB != null)
            {
                if (GH_Format.TreatAsCollection(RDB))
                {
                    IEnumerable __enum_RDB = (IEnumerable)(RDB);
                    DA.SetDataList(3, __enum_RDB);
                }
                else
                {
                    if (RDB is Grasshopper.Kernel.Data.IGH_DataTree)
                    {
                        //merge tree
                        DA.SetDataTree(3, (Grasshopper.Kernel.Data.IGH_DataTree)(RDB));
                    }
                    else
                    {
                        //assign direct
                        DA.SetData(3, RDB);
                    }
                }
            }
            else
            {
                DA.SetData(3, null);
            }
            if (RDC != null)
            {
                if (GH_Format.TreatAsCollection(RDC))
                {
                    IEnumerable __enum_RDC = (IEnumerable)(RDC);
                    DA.SetDataList(4, __enum_RDC);
                }
                else
                {
                    if (RDC is Grasshopper.Kernel.Data.IGH_DataTree)
                    {
                        //merge tree
                        DA.SetDataTree(4, (Grasshopper.Kernel.Data.IGH_DataTree)(RDC));
                    }
                    else
                    {
                        //assign direct
                        DA.SetData(4, RDC);
                    }
                }
            }
            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);
                    }
                }
            }
        }
    }
Exemplo n.º 9
0
    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 <Point3d> P0 = null;

        if (inputs[1] != null)
        {
            P0 = GH_DirtyCaster.CastToList <Point3d>(inputs[1]);
        }
        double radius = default(double);

        if (inputs[2] != null)
        {
            radius = (double)(inputs[2]);
        }

        bool UseRTRee = default(bool);

        if (inputs[3] != null)
        {
            UseRTRee = (bool)(inputs[3]);
        }



        //3. Declare output parameters
        object A = null;
        object B = null;


        //4. Invoke RunScript
        RunScript(P, P0, radius, UseRTRee, ref A, ref B);

        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);
            }
        }
        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);
                    }
                }
            }
        }
    }
Exemplo n.º 10
0
    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);
                    }
                }
            }
        }
    }
Exemplo n.º 11
0
    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 x = default(int);

        if (inputs[0] != null)
        {
            x = (int)(inputs[0]);
        }

        int y = default(int);

        if (inputs[1] != null)
        {
            y = (int)(inputs[1]);
        }

        int ind = default(int);

        if (inputs[2] != null)
        {
            ind = (int)(inputs[2]);
        }

        bool wrap = default(bool);

        if (inputs[3] != null)
        {
            wrap = (bool)(inputs[3]);
        }



        //3. Declare output parameters
        object P    = null;
        object nInd = null;


        //4. Invoke RunScript
        RunScript(x, y, ind, wrap, ref P, ref nInd);

        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 (nInd != null)
            {
                if (GH_Format.TreatAsCollection(nInd))
                {
                    IEnumerable __enum_nInd = (IEnumerable)(nInd);
                    DA.SetDataList(2, __enum_nInd);
                }
                else
                {
                    if (nInd is Grasshopper.Kernel.Data.IGH_DataTree)
                    {
                        //merge tree
                        DA.SetDataTree(2, (Grasshopper.Kernel.Data.IGH_DataTree)(nInd));
                    }
                    else
                    {
                        //assign direct
                        DA.SetData(2, nInd);
                    }
                }
            }
            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 <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
        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);
                    }
                }
            }
        }
    }
Exemplo n.º 15
0
    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
        string FilePath = default(string);

        if (inputs[0] != null)
        {
            FilePath = (string)(inputs[0]);
        }

        Point3d origin = default(Point3d);

        if (inputs[1] != null)
        {
            origin = (Point3d)(inputs[1]);
        }

        double Scale = default(double);

        if (inputs[2] != null)
        {
            Scale = (double)(inputs[2]);
        }



        //3. Declare output parameters
        object Crv  = null;
        object Pt   = null;
        object Type = null;


        //4. Invoke RunScript
        RunScript(FilePath, origin, Scale, ref Crv, ref Pt, ref Type);

        try
        {
            //5. Assign output parameters to component...
            if (Crv != null)
            {
                if (GH_Format.TreatAsCollection(Crv))
                {
                    IEnumerable __enum_Crv = (IEnumerable)(Crv);
                    DA.SetDataList(1, __enum_Crv);
                }
                else
                {
                    if (Crv is Grasshopper.Kernel.Data.IGH_DataTree)
                    {
                        //merge tree
                        DA.SetDataTree(1, (Grasshopper.Kernel.Data.IGH_DataTree)(Crv));
                    }
                    else
                    {
                        //assign direct
                        DA.SetData(1, Crv);
                    }
                }
            }
            else
            {
                DA.SetData(1, null);
            }
            if (Pt != null)
            {
                if (GH_Format.TreatAsCollection(Pt))
                {
                    IEnumerable __enum_Pt = (IEnumerable)(Pt);
                    DA.SetDataList(2, __enum_Pt);
                }
                else
                {
                    if (Pt is Grasshopper.Kernel.Data.IGH_DataTree)
                    {
                        //merge tree
                        DA.SetDataTree(2, (Grasshopper.Kernel.Data.IGH_DataTree)(Pt));
                    }
                    else
                    {
                        //assign direct
                        DA.SetData(2, Pt);
                    }
                }
            }
            else
            {
                DA.SetData(2, null);
            }
            if (Type != null)
            {
                if (GH_Format.TreatAsCollection(Type))
                {
                    IEnumerable __enum_Type = (IEnumerable)(Type);
                    DA.SetDataList(3, __enum_Type);
                }
                else
                {
                    if (Type is Grasshopper.Kernel.Data.IGH_DataTree)
                    {
                        //merge tree
                        DA.SetDataTree(3, (Grasshopper.Kernel.Data.IGH_DataTree)(Type));
                    }
                    else
                    {
                        //assign direct
                        DA.SetData(3, Type);
                    }
                }
            }
            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
        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);
                    }
                }
            }
        }
    }
 public override string ToString()
 {
     return(GH_Format.FormatColour((System.Drawing.Color)Value));
 }
Exemplo n.º 18
0
    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);
                    }
                }
            }
        }
    }
Exemplo n.º 19
0
    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);
                    }
                }
            }
        }
    }
Exemplo n.º 20
0
    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
        bool reset = default(bool);

        if (inputs[0] != null)
        {
            reset = (bool)(inputs[0]);
        }

        bool go = default(bool);

        if (inputs[1] != null)
        {
            go = (bool)(inputs[1]);
        }

        List <Point3d> P = null;

        if (inputs[2] != null)
        {
            P = GH_DirtyCaster.CastToList <Point3d>(inputs[2]);
        }
        List <Vector3d> V = null;

        if (inputs[3] != null)
        {
            V = GH_DirtyCaster.CastToList <Vector3d>(inputs[3]);
        }
        double nR = default(double);

        if (inputs[4] != null)
        {
            nR = (double)(inputs[4]);
        }

        double coS = default(double);

        if (inputs[5] != null)
        {
            coS = (double)(inputs[5]);
        }

        double alS = default(double);

        if (inputs[6] != null)
        {
            alS = (double)(inputs[6]);
        }

        double seS = default(double);

        if (inputs[7] != null)
        {
            seS = (double)(inputs[7]);
        }

        double seR = default(double);

        if (inputs[8] != null)
        {
            seR = (double)(inputs[8]);
        }



        //3. Declare output parameters
        object Ap = null;
        object Av = null;


        //4. Invoke RunScript
        RunScript(reset, go, P, V, nR, coS, alS, seS, seR, ref Ap, ref Av);

        try
        {
            //5. Assign output parameters to component...
            if (Ap != null)
            {
                if (GH_Format.TreatAsCollection(Ap))
                {
                    IEnumerable __enum_Ap = (IEnumerable)(Ap);
                    DA.SetDataList(1, __enum_Ap);
                }
                else
                {
                    if (Ap is Grasshopper.Kernel.Data.IGH_DataTree)
                    {
                        //merge tree
                        DA.SetDataTree(1, (Grasshopper.Kernel.Data.IGH_DataTree)(Ap));
                    }
                    else
                    {
                        //assign direct
                        DA.SetData(1, Ap);
                    }
                }
            }
            else
            {
                DA.SetData(1, null);
            }
            if (Av != null)
            {
                if (GH_Format.TreatAsCollection(Av))
                {
                    IEnumerable __enum_Av = (IEnumerable)(Av);
                    DA.SetDataList(2, __enum_Av);
                }
                else
                {
                    if (Av is Grasshopper.Kernel.Data.IGH_DataTree)
                    {
                        //merge tree
                        DA.SetDataTree(2, (Grasshopper.Kernel.Data.IGH_DataTree)(Av));
                    }
                    else
                    {
                        //assign direct
                        DA.SetData(2, Av);
                    }
                }
            }
            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);
                    }
                }
            }
        }
    }
Exemplo n.º 21
0
  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);
        }
      }
    }
  }
Exemplo n.º 22
0
    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]);
        }

        double y = default(double);

        if (inputs[1] != null)
        {
            y = (double)(inputs[1]);
        }

        double x_origin = default(double);

        if (inputs[2] != null)
        {
            x_origin = (double)(inputs[2]);
        }

        double y_origin = default(double);

        if (inputs[3] != null)
        {
            y_origin = (double)(inputs[3]);
        }



        //3. Declare output parameters
        object aa = null;
        object bb = null;


        //4. Invoke RunScript
        RunScript(x, y, x_origin, y_origin, ref aa, ref bb);

        try
        {
            //5. Assign output parameters to component...
            if (aa != null)
            {
                if (GH_Format.TreatAsCollection(aa))
                {
                    IEnumerable __enum_aa = (IEnumerable)(aa);
                    DA.SetDataList(1, __enum_aa);
                }
                else
                {
                    if (aa is Grasshopper.Kernel.Data.IGH_DataTree)
                    {
                        //merge tree
                        DA.SetDataTree(1, (Grasshopper.Kernel.Data.IGH_DataTree)(aa));
                    }
                    else
                    {
                        //assign direct
                        DA.SetData(1, aa);
                    }
                }
            }
            else
            {
                DA.SetData(1, null);
            }
            if (bb != null)
            {
                if (GH_Format.TreatAsCollection(bb))
                {
                    IEnumerable __enum_bb = (IEnumerable)(bb);
                    DA.SetDataList(2, __enum_bb);
                }
                else
                {
                    if (bb is Grasshopper.Kernel.Data.IGH_DataTree)
                    {
                        //merge tree
                        DA.SetDataTree(2, (Grasshopper.Kernel.Data.IGH_DataTree)(bb));
                    }
                    else
                    {
                        //assign direct
                        DA.SetData(2, bb);
                    }
                }
            }
            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
        Vector3d V = default(Vector3d);

        if (inputs[0] != null)
        {
            V = (Vector3d)(inputs[0]);
        }



        //3. Declare output parameters
        object VSort = null;
        object vStar = null;


        //4. Invoke RunScript
        RunScript(V, ref VSort, ref vStar);

        try
        {
            //5. Assign output parameters to component...
            if (VSort != null)
            {
                if (GH_Format.TreatAsCollection(VSort))
                {
                    IEnumerable __enum_VSort = (IEnumerable)(VSort);
                    DA.SetDataList(1, __enum_VSort);
                }
                else
                {
                    if (VSort is Grasshopper.Kernel.Data.IGH_DataTree)
                    {
                        //merge tree
                        DA.SetDataTree(1, (Grasshopper.Kernel.Data.IGH_DataTree)(VSort));
                    }
                    else
                    {
                        //assign direct
                        DA.SetData(1, VSort);
                    }
                }
            }
            else
            {
                DA.SetData(1, null);
            }
            if (vStar != null)
            {
                if (GH_Format.TreatAsCollection(vStar))
                {
                    IEnumerable __enum_vStar = (IEnumerable)(vStar);
                    DA.SetDataList(2, __enum_vStar);
                }
                else
                {
                    if (vStar is Grasshopper.Kernel.Data.IGH_DataTree)
                    {
                        //merge tree
                        DA.SetDataTree(2, (Grasshopper.Kernel.Data.IGH_DataTree)(vStar));
                    }
                    else
                    {
                        //assign direct
                        DA.SetData(2, vStar);
                    }
                }
            }
            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);
                    }
                }
            }
        }
    }
Exemplo n.º 24
0
    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
        Mesh M = default(Mesh);

        if (inputs[0] != null)
        {
            M = (Mesh)(inputs[0]);
        }

        Mesh V = default(Mesh);

        if (inputs[1] != null)
        {
            V = (Mesh)(inputs[1]);
        }

        int n = default(int);

        if (inputs[2] != null)
        {
            n = (int)(inputs[2]);
        }

        int s = default(int);

        if (inputs[3] != null)
        {
            s = (int)(inputs[3]);
        }



        //3. Declare output parameters
        object Pts = null;


        //4. Invoke RunScript
        RunScript(M, V, n, s, ref Pts);

        try
        {
            //5. Assign output parameters to component...
            if (Pts != null)
            {
                if (GH_Format.TreatAsCollection(Pts))
                {
                    IEnumerable __enum_Pts = (IEnumerable)(Pts);
                    DA.SetDataList(0, __enum_Pts);
                }
                else
                {
                    if (Pts is Grasshopper.Kernel.Data.IGH_DataTree)
                    {
                        //merge tree
                        DA.SetDataTree(0, (Grasshopper.Kernel.Data.IGH_DataTree)(Pts));
                    }
                    else
                    {
                        //assign direct
                        DA.SetData(0, Pts);
                    }
                }
            }
            else
            {
                DA.SetData(0, 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);
                    }
                }
            }
        }
    }
Exemplo n.º 25
0
    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
        Mesh mesh = default(Mesh);

        if (inputs[0] != null)
        {
            mesh = (Mesh)(inputs[0]);
        }

        Vector3d direction = default(Vector3d);

        if (inputs[1] != null)
        {
            direction = (Vector3d)(inputs[1]);
        }

        Color color = default(Color);

        if (inputs[2] != null)
        {
            color = (Color)(inputs[2]);
        }

        double intensity = default(double);

        if (inputs[3] != null)
        {
            intensity = (double)(inputs[3]);
        }



        //3. Declare output parameters
        object result = null;


        //4. Invoke RunScript
        RunScript(mesh, direction, color, intensity, 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 <double> Density = null;

        if (inputs[0] != null)
        {
            Density = GH_DirtyCaster.CastToList <double>(inputs[0]);
        }
        double RemapIndex = default(double);

        if (inputs[1] != null)
        {
            RemapIndex = (double)(inputs[1]);
        }



        //3. Declare output parameters
        object FAR = null;


        //4. Invoke RunScript
        RunScript(Density, RemapIndex, ref FAR);

        try
        {
            //5. Assign output parameters to component...
            if (FAR != null)
            {
                if (GH_Format.TreatAsCollection(FAR))
                {
                    IEnumerable __enum_FAR = (IEnumerable)(FAR);
                    DA.SetDataList(1, __enum_FAR);
                }
                else
                {
                    if (FAR is Grasshopper.Kernel.Data.IGH_DataTree)
                    {
                        //merge tree
                        DA.SetDataTree(1, (Grasshopper.Kernel.Data.IGH_DataTree)(FAR));
                    }
                    else
                    {
                        //assign direct
                        DA.SetData(1, FAR);
                    }
                }
            }
            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);
                    }
                }
            }
        }
    }
Exemplo n.º 27
0
    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);
                    }
                }
            }
        }
    }