@@ -11,7 +11,7 @@ def add_str_valuelist(comp,
1111 indx : int ,
1212 X_param_coord : float ,
1313 Y_param_coord : float ,
14- X_offset : int = 87
14+ X_offset : int = 87
1515 ) -> None :
1616 """
1717 Adds a value list of string values to the component input
@@ -53,7 +53,7 @@ def add_slider(comp,
5353 default_value : float ,
5454 X_param_coord : float ,
5555 Y_param_coord : float ,
56- X_offset : int = 100
56+ X_offset : int = 100
5757 ) -> None :
5858 """
5959 Adds a slider to the component input
@@ -85,13 +85,13 @@ def add_slider(comp,
8585 inp .AddSource (slider ) # noqa: F821
8686
8787
88- def add_plane_object (comp ,
89- nickname : str ,
90- indx : int ,
91- X_param_coord : float ,
92- Y_param_coord : float ,
93- X_offset : int = 75
94- ) -> None :
88+ def add_plane_object (comp ,
89+ nickname : str ,
90+ indx : int ,
91+ X_param_coord : float ,
92+ Y_param_coord : float ,
93+ X_offset : int = 75
94+ ) -> None :
9595 """
9696 Adds a plane object to the component input
9797
@@ -117,7 +117,19 @@ def add_plane_object(comp,
117117 inp .AddSource (plane ) # noqa: F821
118118
119119
120- def add_button (comp , nickname , indx , x_offset = 60 ):
120+ def add_button (comp ,
121+ nickname : str ,
122+ indx : int ,
123+ x_offset : int = 60
124+ ) -> None :
125+ """
126+ Adds a one-shot Boolean button to the left of a component input.
127+
128+ :param comp: The Grasshopper component to which the button will be added.
129+ :param nickname: The display label of the button (e.g. "Start", "Load").
130+ :param indx: The index of the component input to wire the button into.
131+ :param x_offset: Horizontal distance (in pixels) to place the button to the left of the input.
132+ """
121133
122134 inp = comp .Params .Input [indx ]
123135 # only add if nothing already connected
@@ -143,7 +155,25 @@ def add_button(comp, nickname, indx, x_offset=60):
143155 inp .AddSource (btn )
144156
145157
146- def add_panel (comp , nickname , text , indx , x_offset = 60 , panel_height = 20 ):
158+ def add_panel (comp ,
159+ nickname : str ,
160+ text : str ,
161+ indx : int ,
162+ x_offset : int = 60 ,
163+ panel_height : int = 20
164+ ) -> None :
165+ """
166+ Adds a text panel to the left of a component input with a default string value.
167+
168+ :param comp: The Grasshopper component to which the panel will be added.
169+ :param nickname: The label shown at the top of the panel (e.g. "Host", "Port").
170+ :param text: The default string to display inside the panel.
171+ :param indx: The index of the component input to connect the panel to.
172+ :param x_offset: Horizontal distance (in pixels) to place the panel left of the input.
173+ :param panel_height: Height of the panel in pixels (default is 20).
174+
175+ :returns: None. The panel is created, positioned, and connected if no existing source is present.
176+ """
147177
148178 inp = comp .Params .Input [indx ]
149179 if inp .SourceCount == 0 :
0 commit comments