Grasshopper

algorithmic modeling for Rhino

Custom component in VS 2012 - it doesn´t appear in Grasshopper 09.0014

A am applying Ben Stiller custom component tutorial in Visual Studio 2012, but the component doesn't show in Grasshopper

The version is:

009. 0014

Souce code:

using Grasshopper.Kernel;
using System;
using System.Drawing;


namespace Component_Grasshopper01
{
    class HelloWorld : GH_Component
    {
        public HelloWorld() : base("HelloWorld", "HW", "Hello World Do VASCO", "Extra", "HelloWorld") { }
        //registar parametros de input
        protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager)
        {
            pManager.AddBooleanParameter("Execute", "E", "Execute?", GH_ParamAccess.item);
        }
        //registar parametros de output
        protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager)
        {
                   
            pManager.AddTextParameter("result", "R", "String", GH_ParamAccess.item);
        }

        /// <summary>
        /// EXECUTAR COMPONENT
        /// </summary>
        /// <param name="DA"></param>
        protected override void SolveInstance(IGH_DataAccess DA) {
        
            Boolean input01 = false;

            DA.GetData<Boolean>(0, ref input01);

            if (input01 == true)
            {
                DA.SetData(0, "Hello World");

            }

            
        
        }

        public override Guid ComponentGuid
        {
            // Tools> vreate GUID
            get { return new Guid("73C588F0-362A-4EDB-A092-513CF4281835"); }
        }
        protected override Bitmap Icon
        {
            get {

                return Component_Grasshopper01.Properties.Resources.LOGO;
               
            }
        }
    }
}

Any ideas????

Views: 443

Replies to This Discussion

Can you upload the GHA file you're compiling?

Incidencally, the bold text in the following can be removed entirely without affecting the logic:

DA.GetData<Boolean>(0, ref input01);
if (input01 == true)
{
  DA.SetData(0, "Hello World");
}

--

David Rutten

david@mcneel.com

Poprad, Slovakia

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2025   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service