ladybug_rhino.versioning.export module¶
Functions for exporting all content from Grasshopper component objects.
- ladybug_rhino.versioning.export.clean_component_filename(component)[source]¶
Get a clean filename derived from a component’s name.
- ladybug_rhino.versioning.export.export_component(folder, component, change_type='fix')[source]¶
Export a Grasshopper component object to a package folder.
This method writes the following files:
A .ghuser into the user_objects subfolder
A .py file into the src subfolder
A .json into the json subfolder
A .png into the icon subfolder
- Parameters:
folder – Path to a folder into which the component files will be exported. Typically, this is the package folder of a grasshopper plugin repo. (eg. ladybug-grasshopper/ladybug_grasshopper).
component – The Grasshopper component object to be exported to the folder.
change_type – Text for the change type of the export. Valid change types can be seen under the CHANGE_TAGS property of the userobject module.
- ladybug_rhino.versioning.export.export_component_icon(folder, component)[source]¶
Export a Grasshopper component icon to a folder.
- Parameters:
folder – Path to a folder into which the icon image file will be exported.
component – The Grasshopper component object to be exported to the folder.
- ladybug_rhino.versioning.export.export_component_screen_capture(folder, component, x_dim=1000, y_dim=1000)[source]¶
Export a screen capture of a Grasshopper component object to a folder.
The image will always be centered on the component and at a resolution where the inputs and outputs are clearly visible.
- Parameters:
folder – Path to a folder into which the image file will be exported.
component – The Grasshopper component object to be exported to the folder.
x_dim – Integer for the X dimension of the exported image in pixels. (Default: 1000).
y_dim – Integer for the X dimension of the exported image in pixels. (Default: 1000).
- ladybug_rhino.versioning.export.export_component_to_markdown(folder, component, github_repo=None)[source]¶
Export a Grasshopper component’s description and metadata to a Markdown file.
- Parameters:
folder – Path to a folder into which the MArkdown file will be exported.
component – The Grasshopper component object to be exported to the folder.
github_repo – Optional URL to a GitHub repo that can be used to link the Markdown page to a GitHub repository.
- ladybug_rhino.versioning.export.export_plugin_to_markdown(folder, plugin_name)[source]¶
Export a Grasshopper plugin and its subcategories to Markdown files.
- Parameters:
folder – Path to a folder into which the icon image file will be exported.
plugin_name – Text for the name of a particular plugin (aka. insect) to place components from (eg. “Ladybug”, “Honeybee”, “HB-Energy”).