Imports Grasshopper.Kernel Imports Grasshopper.Kernel.Data Imports Grasshopper.Kernel.Types Namespace Kernel.Components Public Class Component_OptionalTreeComponent Inherits GH_Component Public Sub New() MyBase.New("Optional Tree", "OptTree", "Optional tree test", "Tree", "Blah") End Sub Public Overrides ReadOnly Property ComponentGuid() As System.Guid Get Return New Guid("{530941C3-7968-4e2f-A63F-FCFACCE68008}") End Get End Property Protected Overrides Sub RegisterInputParams(ByVal pManager As GH_Component.GH_InputParamManager) pManager.Register_StringParam("Text", "T", "Optional text", GH_ParamAccess.tree) pManager(0).Optional = True End Sub Protected Overrides Sub RegisterOutputParams(ByVal pManager As GH_Component.GH_OutputParamManager) pManager.Register_StringParam("Result", "R", "Blacvh") End Sub Protected Overrides Sub SolveInstance(ByVal DA As IGH_DataAccess) Dim data As New GH_Structure(Of GH_String) DA.GetDataTree(0, data) If (data.IsEmpty) Then data.Append(New GH_String("Empty")) End If DA.SetData(0, data.DataDescription(True, True)) End Sub End Class End Namespace