ladybug_rhino.versioning.gather module

Functions for gathering connected components or all components on a canvas.

ladybug_rhino.versioning.gather.gather_canvas_components(component)[source]

Get all of the Ladybug Tools components on the same canvas as the input component.

This will also gather any Ladybug Tools components inside of clusters.

Parameters:

component – A Grasshopper component object. Typically, this should be the exporter component object, which can be accessed through the ghenv.Component call.

Returns:

A list of Ladybug Tools component objects on the same canvas as the input component. The input component is excluded from this list.

ladybug_rhino.versioning.gather.gather_connected_components(component)[source]

Get all of the GHPython components connected to the component’s first input.

Parameters:

component – A Grasshopper component object. Typically, this should be the exporter component object, which can be accessed through the ghenv.Component call.

Returns:

A list of Ladybug Tools component objects that are connected to the component’s first input.

ladybug_rhino.versioning.gather.is_ladybug_tools(component)[source]

Check if a component is a part of Ladybug Tools.

ladybug_rhino.versioning.gather.place_component(component_reference, component_name, x_position=200, y_position=200, hold_solution=False)[source]

Place a single component on the canvas.

Parameters:
  • component_reference – A Grasshopper component reference object to be placed on the canvas.

  • component_name – Text for the name of the component being placed.

  • x_position – An integer for where in the X dimension of the canvas the components will be dropped. (Default: 200).

  • y_position – An integer for where in the Y dimension of the canvas the components will be dropped. (Default: 200).

  • hold_solution – Boolean to note whether to hold off on the solution after the component is dropped on the canvas. (Default: False).

Returns:

The Component Object for the components that have been dropped onto the canvas.

ladybug_rhino.versioning.gather.place_plugin_components(plugin_name, sub_category=None, x_position=200, y_position=200)[source]

Place all of the components of a specific Ladybug Tools Plugin on the canvas.

Parameters:
  • plugin_name – Text for the name of a particular plugin (aka. insect) to place components from (eg. “Ladybug”, “Honeybee”, “HB-Energy”).

  • sub_category – Text for a specific plugin sub-category (aka. tab) to be exported (eg. “1 :: Analyze Data”). If None, all components in the plugin will be places on the canvas. (Default: None).

  • x_position – An integer for where in the X dimension of the canvas the components will be dropped. (Default: 200).

  • y_position – An integer for where in the Y dimension of the canvas the components will be dropped. (Default: 200).

Returns:

A list of Component Objects for the components that have been dropped onto the canvas. These component objects can be used to update the version of the dropped component, change their category, etc.

ladybug_rhino.versioning.gather.plugin_components(plugin_name, sub_category=None)[source]

Get all of the components of a Ladybug Tools Plugin from the component server.

Parameters:
  • plugin_name – Text for the name of a particular plugin (aka. insect) to place components from (eg. “Ladybug”, “Honeybee”, “HB-Energy”).

  • sub_category – Text for a specific plugin sub-category (aka. tab) to be exported (eg. “1 :: Analyze Data”). If None, all components in the plugin will be places on the canvas. (Default: None).

Returns:

A dictionary of the plugin components with the name of the component as the key and the component object as the value.

ladybug_rhino.versioning.gather.remove_component(component)[source]

Remove a Grasshopper component from the canvas.

Parameters:

component – The Grasshopper component object to be removed.