config.xml Attribute Extension - pytha-3d-cad/pytha-lua-api GitHub Wiki

An attribute extension is invoked when PYTHA calculates an attribute for an element. This may occur in the parts list, in the attributes dialog, etc.

Declaration of an attribute extension in the config.xml:

<extension type="attribute">
    <id>attribute-id</id>
    <entry-point>eval</entry-point>
    <caption>Attribute-Name</caption>
    <description>A short description of the attribute</description>
</extension>
  • id - The extension-id of the attribute is used by PYTHA in conjunction with the guid of the plugin to uniquely identify the attribute. May contain letters, numbers, _ and -. May not contain other special characters or spaces.
  • entry-point - (Optional) The lua function that is invoked to calculate the attribute. If no entry point is provided, then the attribute is a plain data-store.
  • caption - The name by which the user can select the attribute. This text can be localized by the .xlif file.
  • description - A description of the attribute. This text can be localized by the .xlif file.

The function defined as entry-point will be invoked with one parameter:

eval(element)
Parameter Type Description
element element_handle handle to the element for which the attribute should be evaluated

See also:

config.xml, Function Extension, Edit Extension, Anatomy of a Lua Api Plugin, Localization and Translation, Element Handles

⚠️ **GitHub.com Fallback** ⚠️