config.xml Edit Extension - pytha-3d-cad/pytha-lua-api GitHub Wiki
An edit extension is invoked when the user right-clicks on a part and selected "Edit". In order for the an edit extension to be invoked, the part (or one of its parent groups) must have a history that has been set by the same plugin with a call to set_element_history. The id parameter to this function must match the id of the edit extension (see below).
Declaration of an edit extension in the config.xml:
<extension type="edit">
<id>history-id</id>
<entry-point>edit</entry-point>
</extension>The following information can be supplied:
-
id- (Optional) An identifier string to distinguish several edit extensions. When a user invokes edit in the PYTHA user interface, the edit extension is selected by its id-value to match theidsupplied inset_element_history. -
entry-point- (Mandatory) Name of the lua function that is invoked when the user presses the button.
The function defined as entry-point will be invoked with two parameters
edit(element, selected_element)| Parameter | Type | Description |
|---|---|---|
element |
element_handle |
Element handle of the element that contains the history information |
selected_element |
element_handle |
Element handle of the element that was selected in the scene |
To get the history information for the element, use pytha.get_element_history.
selected_element may be different from element, e.g. when a part was selected of which the parent group contains the history information.
config.xml, Function Extension, Attribute Extension, Anatomy of a Lua Api Plugin, Localization and Translation, Element Handles