コード例 #1
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            string  Text         = "";
            Hu_Font TextFont     = new Hu_Font();
            Plane   TextLocation = default(Plane);

            if (!DA.GetData(0, ref Text))
            {
                return;
            }
            if (!DA.GetData(1, ref TextFont))
            {
                return;
            }
            if (!DA.GetData(2, ref TextLocation))
            {
                return;
            }

            TextObj = new TextEntity();

            TextObj.RichText   = Text;
            TextObj.Font       = new Rhino.DocObjects.Font(TextFont.FontFace);
            TextObj.Plane      = TextLocation;
            TextObj.TextHeight = TextFont.FontHeight;
            TextObj.SetItalic(TextFont.IsItalic);
            TextObj.SetBold(TextFont.IsBold);
            TextObj.TextHorizontalAlignment = TextHorizontalAlignment.Center;

            DA.SetData(0, TextObj);
        }
コード例 #2
0
 protected override GH_GetterResult Prompt_Singular(ref Types.Hu_Font value)
 {
     System.Drawing.Font Font = GH_FontPicker.ShowFontPickerWindow(GH_FontServer.Standard);
     if (Font == null)
     {
         return(GH_GetterResult.cancel);
     }
     value = new Hu_Font(Font);
     return(GH_GetterResult.success);
 }