using Rhino; using Rhino.Geometry; using Rhino.DocObjects; using Rhino.Collections; using GH_IO; using GH_IO.Serialization; using Grasshopper; using Grasshopper.Kernel; using Grasshopper.Kernel.Data; using Grasshopper.Kernel.Types; using System; using System.IO; using System.Xml; using System.Xml.Linq; using System.Linq; using System.Data; using System.Drawing; using System.Reflection; using System.Collections; using System.Windows.Forms; using System.Collections.Generic; using System.Runtime.InteropServices; /// /// This class will be instantiated on demand by the Script component. /// public class Script_Instance : GH_ScriptInstance { #region Utility functions /// Print a String to the [Out] Parameter of the Script component. /// String to print. private void Print(string text) { /* Implementation hidden. */ } /// Print a formatted String to the [Out] Parameter of the Script component. /// String format. /// Formatting parameters. private void Print(string format, params object[] args) { /* Implementation hidden. */ } /// Print useful information about an object instance to the [Out] Parameter of the Script component. /// Object instance to parse. private void Reflect(object obj) { /* Implementation hidden. */ } /// Print the signatures of all the overloads of a specific method to the [Out] Parameter of the Script component. /// Object instance to parse. private void Reflect(object obj, string method_name) { /* Implementation hidden. */ } #endregion #region Members /// Gets the current Rhino document. private readonly RhinoDoc RhinoDocument; /// Gets the Grasshopper document that owns this script. private readonly GH_Document GrasshopperDocument; /// Gets the Grasshopper script component that owns this script. private readonly IGH_Component Component; /// /// Gets the current iteration count. The first call to RunScript() is associated with Iteration==0. /// Any subsequent call within the same solution will increment the Iteration count. /// private readonly int Iteration; #endregion /// /// This procedure contains the user code. Input parameters are provided as regular arguments, /// Output parameters as ref arguments. You don't have to assign output parameters, /// they will have a default value. /// private void RunScript(object x, object y, ref object A) { System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.AppendLine(string.Format("Default zoom: {0:0.0}%", 100.0 * Grasshopper.GUI.Canvas.GH_Viewport.ZoomDefault)); sb.AppendLine(string.Format("Lower zoom: {0:0.0}%", 100.0 * Grasshopper.GUI.Canvas.GH_Viewport.ZoomDefaultLower)); sb.AppendLine(string.Format("Upper zoom: {0:0.0}%", 100.0 * Grasshopper.GUI.Canvas.GH_Viewport.ZoomDefaultUpper)); sb.AppendLine(string.Format("Canvas Fade low: {0:0}#", Grasshopper.GUI.Canvas.GH_Canvas.ZoomFadeLow)); sb.AppendLine(string.Format("Canvas Fade medium: {0:0}#", Grasshopper.GUI.Canvas.GH_Canvas.ZoomFadeMedium)); sb.AppendLine(string.Format("Canvas Fade high: {0:0}#", Grasshopper.GUI.Canvas.GH_Canvas.ZoomFadeHigh)); System.Windows.Forms.Clipboard.SetText(sb.ToString(), TextDataFormat.Text); } // // }