Skip to content

extensions

Base module for handling extensions parsing.

Attributes

LIB_EXTENSION_POSTFIX = '.lib' module-attribute

UI_EXTENSION_POSTFIX = '.extension' module-attribute

PYTHON_LANG = 'python' module-attribute

CSHARP_LANG = 'csharp' module-attribute

VB_LANG = 'visualbasic' module-attribute

RUBY_LANG = 'ruby' module-attribute

DYNAMO_LANG = 'dynamobim' module-attribute

GRASSHOPPER_LANG = 'grasshopper' module-attribute

CPYTHON_HASHBANG = '#! python3' module-attribute

PYTHON_SCRIPT_FILE_FORMAT = '.py' module-attribute

CSHARP_SCRIPT_FILE_FORMAT = '.cs' module-attribute

VB_SCRIPT_FILE_FORMAT = '.vb' module-attribute

RUBY_SCRIPT_FILE_FORMAT = '.rb' module-attribute

DYNAMO_SCRIPT_FILE_FORMAT = '.dyn' module-attribute

GRASSHOPPER_SCRIPT_FILE_FORMAT = '.gh' module-attribute

GRASSHOPPERX_SCRIPT_FILE_FORMAT = '.ghx' module-attribute

CONTENT_FILE_FORMAT = '.rfa' module-attribute

EXT_STARTUP_NAME = 'startup' module-attribute

PYTHON_EXT_STARTUP_FILE = EXT_STARTUP_NAME + PYTHON_SCRIPT_FILE_FORMAT module-attribute

CSHARP_EXT_STARTUP_FILE = EXT_STARTUP_NAME + CSHARP_SCRIPT_FILE_FORMAT module-attribute

VB_EXT_STARTUP_FILE = EXT_STARTUP_NAME + VB_SCRIPT_FILE_FORMAT module-attribute

RUBY_EXT_STARTUP_FILE = EXT_STARTUP_NAME + RUBY_SCRIPT_FILE_FORMAT module-attribute

YAML_FILE_FORMAT = '.yaml' module-attribute

JSON_FILE_FORMAT = '.json' module-attribute

EXT_MANIFEST_NAME = 'extension' module-attribute

EXT_MANIFEST_FILE = EXT_MANIFEST_NAME + JSON_FILE_FORMAT module-attribute

DEFAULT_BUNDLEMATA_NAME = 'bundle' module-attribute

BUNDLEMATA_POSTFIX = DEFAULT_BUNDLEMATA_NAME + YAML_FILE_FORMAT module-attribute

MDATA_UI_TITLE = 'title' module-attribute

MDATA_TOOLTIP = 'tooltip' module-attribute

MDATA_AUTHOR = 'author' module-attribute

MDATA_AUTHORS = 'authors' module-attribute

MDATA_LAYOUT = 'layout' module-attribute

MDATA_COMMAND_HELP_URL = 'help_url' module-attribute

MDATA_COMMAND_CONTEXT = 'context' module-attribute

MDATA_COMMAND_CONTEXT_TYPE = 'type' module-attribute

MDATA_COMMAND_CONTEXT_NOT = 'not_' module-attribute

MDATA_COMMAND_CONTEXT_ANY = 'any' module-attribute

MDATA_COMMAND_CONTEXT_ALL = 'all' module-attribute

MDATA_COMMAND_CONTEXT_EXACT = 'exact' module-attribute

MDATA_COMMAND_CONTEXT_NOTANY = MDATA_COMMAND_CONTEXT_NOT + MDATA_COMMAND_CONTEXT_ANY module-attribute

MDATA_COMMAND_CONTEXT_NOTALL = MDATA_COMMAND_CONTEXT_NOT + MDATA_COMMAND_CONTEXT_ALL module-attribute

MDATA_COMMAND_CONTEXT_NOTEXACT = MDATA_COMMAND_CONTEXT_NOT + MDATA_COMMAND_CONTEXT_EXACT module-attribute

MDATA_COMMAND_CONTEXT_ANY_SEP = '|' module-attribute

MDATA_COMMAND_CONTEXT_ALL_SEP = '&' module-attribute

MDATA_COMMAND_CONTEXT_EXACT_SEP = ';' module-attribute

MDATA_COMMAND_CONTEXT_RULE = '({rule})' module-attribute

MDATA_MIN_REVIT_VERSION = 'min_revit_version' module-attribute

MDATA_MAX_REVIT_VERSION = 'max_revit_version' module-attribute

MDATA_BETA_SCRIPT = 'is_beta' module-attribute

MDATA_ENGINE = 'engine' module-attribute

MDATA_ENGINE_CLEAN = 'clean' module-attribute

MDATA_ENGINE_FULLFRAME = 'full_frame' module-attribute

MDATA_ENGINE_PERSISTENT = 'persistent' module-attribute

MDATA_ENGINE_MAINTHREAD = 'mainthread' module-attribute

MDATA_TEMPLATES_KEY = 'templates' module-attribute

MDATA_BACKGROUND_KEY = 'background' module-attribute

MDATA_BACKGROUND_PANEL_KEY = 'panel' module-attribute

MDATA_BACKGROUND_TITLE_KEY = 'title' module-attribute

MDATA_BACKGROUND_SLIDEOUT_KEY = 'slideout' module-attribute

MDATA_HIGHLIGHT_KEY = 'highlight' module-attribute

MDATA_HIGHLIGHT_TYPE_NEW = 'new' module-attribute

MDATA_HIGHLIGHT_TYPE_UPDATED = 'updated' module-attribute

MDATA_COLLAPSED_KEY = 'collapsed' module-attribute

MDATA_ENGINE_DYNAMO_AUTOMATE = 'automate' module-attribute

MDATA_ENGINE_DYNAMO_PATH = 'dynamo_path' module-attribute

MDATA_ENGINE_DYNAMO_PATH_CHECK_EXIST = 'dynamo_path_check_existing' module-attribute

MDATA_ENGINE_DYNAMO_FORCE_MANUAL_RUN = 'dynamo_force_manual_run' module-attribute

MDATA_ENGINE_DYNAMO_MODEL_NODES_INFO = 'dynamo_model_nodes_info' module-attribute

UI_TITLE_PARAM = '__title__' module-attribute

DOCSTRING_PARAM = '__doc__' module-attribute

AUTHOR_PARAM = '__author__' module-attribute

AUTHORS_PARAM = '__authors__' module-attribute

COMMAND_HELP_URL_PARAM = '__helpurl__' module-attribute

COMMAND_CONTEXT_PARAM = '__context__' module-attribute

MIN_REVIT_VERSION_PARAM = '__min_revit_ver__' module-attribute

MAX_REVIT_VERSION_PARAM = '__max_revit_ver__' module-attribute

SHIFT_CLICK_PARAM = '__shiftclick__' module-attribute

BETA_SCRIPT_PARAM = '__beta__' module-attribute

HIGHLIGHT_SCRIPT_PARAM = '__highlight__' module-attribute

CLEAN_ENGINE_SCRIPT_PARAM = '__cleanengine__' module-attribute

FULLFRAME_ENGINE_PARAM = '__fullframeengine__' module-attribute

PERSISTENT_ENGINE_PARAM = '__persistentengine__' module-attribute

TAB_POSTFIX = '.tab' module-attribute

PANEL_POSTFIX = '.panel' module-attribute

INVOKE_BUTTON_POSTFIX = '.invokebutton' module-attribute

PUSH_BUTTON_POSTFIX = '.pushbutton' module-attribute

SMART_BUTTON_POSTFIX = '.smartbutton' module-attribute

PULLDOWN_BUTTON_POSTFIX = '.pulldown' module-attribute

STACK_BUTTON_POSTFIX = '.stack' module-attribute

SPLIT_BUTTON_POSTFIX = '.splitbutton' module-attribute

SPLITPUSH_BUTTON_POSTFIX = '.splitpushbutton' module-attribute

PANEL_PUSH_BUTTON_POSTFIX = '.panelbutton' module-attribute

NOGUI_COMMAND_POSTFIX = '.nobutton' module-attribute

CONTENT_BUTTON_POSTFIX = '.content' module-attribute

URL_BUTTON_POSTFIX = '.urlbutton' module-attribute

COMP_LIBRARY_DIR_NAME = 'lib' module-attribute

COMP_BIN_DIR_NAME = 'bin' module-attribute

COMP_HOOKS_DIR_NAME = 'hooks' module-attribute

COMP_CHECKS_DIR_NAME = 'checks' module-attribute

UNIQUE_ID_SEPARATOR = '-' module-attribute

SEPARATOR_IDENTIFIER = '---' module-attribute

SLIDEOUT_IDENTIFIER = '>>>' module-attribute

ICON_FILE_FORMAT = '.png' module-attribute

ICON_DARK_SUFFIX = '.dark' module-attribute

DEFAULT_ICON_FILE = 'icon' + ICON_FILE_FORMAT module-attribute

DEFAULT_ON_ICON_FILE = 'on' + ICON_FILE_FORMAT module-attribute

DEFAULT_OFF_ICON_FILE = 'off' + ICON_FILE_FORMAT module-attribute

DEFAULT_MEDIA_FILENAME = 'tooltip' module-attribute

DEFAULT_SCRIPT_NAME = 'script' module-attribute

DEFAULT_CONFIG_NAME = 'config' module-attribute

PYTHON_SCRIPT_POSTFIX = DEFAULT_SCRIPT_NAME + PYTHON_SCRIPT_FILE_FORMAT module-attribute

PYTHON_CONFIG_SCRIPT_POSTFIX = DEFAULT_CONFIG_NAME + PYTHON_SCRIPT_FILE_FORMAT module-attribute

CSHARP_SCRIPT_POSTFIX = DEFAULT_SCRIPT_NAME + CSHARP_SCRIPT_FILE_FORMAT module-attribute

CSHARP_CONFIG_SCRIPT_POSTFIX = DEFAULT_CONFIG_NAME + CSHARP_SCRIPT_FILE_FORMAT module-attribute

VB_SCRIPT_POSTFIX = DEFAULT_SCRIPT_NAME + VB_SCRIPT_FILE_FORMAT module-attribute

VB_CONFIG_SCRIPT_POSTFIX = DEFAULT_CONFIG_NAME + VB_SCRIPT_FILE_FORMAT module-attribute

RUBY_SCRIPT_POSTFIX = DEFAULT_SCRIPT_NAME + RUBY_SCRIPT_FILE_FORMAT module-attribute

RUBY_CONFIG_SCRIPT_POSTFIX = DEFAULT_CONFIG_NAME + RUBY_SCRIPT_FILE_FORMAT module-attribute

DYNAMO_SCRIPT_POSTFIX = DEFAULT_SCRIPT_NAME + DYNAMO_SCRIPT_FILE_FORMAT module-attribute

DYNAMO_CONFIG_SCRIPT_POSTFIX = DEFAULT_CONFIG_NAME + DYNAMO_SCRIPT_FILE_FORMAT module-attribute

GRASSHOPPER_SCRIPT_POSTFIX = DEFAULT_SCRIPT_NAME + GRASSHOPPER_SCRIPT_FILE_FORMAT module-attribute

GRASSHOPPER_CONFIG_SCRIPT_POSTFIX = DEFAULT_CONFIG_NAME + GRASSHOPPER_SCRIPT_FILE_FORMAT module-attribute

GRASSHOPPERX_SCRIPT_POSTFIX = DEFAULT_SCRIPT_NAME + GRASSHOPPERX_SCRIPT_FILE_FORMAT module-attribute

GRASSHOPPERX_CONFIG_SCRIPT_POSTFIX = DEFAULT_CONFIG_NAME + GRASSHOPPERX_SCRIPT_FILE_FORMAT module-attribute

DEFAULT_CONTENT_NAME = 'content' module-attribute

DEFAULT_ALT_CONTENT_NAME = 'other' module-attribute

CONTENT_POSTFIX = DEFAULT_CONTENT_NAME + CONTENT_FILE_FORMAT module-attribute

CONTENT_VERSION_POSTFIX = DEFAULT_CONTENT_NAME + '_{version}' + CONTENT_FILE_FORMAT module-attribute

ALT_CONTENT_POSTFIX = DEFAULT_ALT_CONTENT_NAME + CONTENT_FILE_FORMAT module-attribute

ALT_CONTENT_VERSION_POSTFIX = DEFAULT_ALT_CONTENT_NAME + '_{version}' + CONTENT_FILE_FORMAT module-attribute

HELP_FILE_PATTERN = '.*help\\..+' module-attribute

CTX_SELETION = 'selection' module-attribute

CTX_ZERODOC = 'zero-doc' module-attribute

Classes

UIExtensionType

UI extension type.

Attributes

ID = 'extension' class-attribute instance-attribute
POSTFIX = '.extension' class-attribute instance-attribute

LIBExtensionType

Library extension type.

Attributes

ID = 'lib' class-attribute instance-attribute
POSTFIX = '.lib' class-attribute instance-attribute

ExtensionTypes

Extension types.

Attributes

UI_EXTENSION = UIExtensionType class-attribute instance-attribute
LIB_EXTENSION = LIBExtensionType class-attribute instance-attribute

Functions

get_ext_types() classmethod
Source code in pyrevitlib/pyrevit/extensions/__init__.py
@classmethod
def get_ext_types(cls):
    ext_types = set()
    for attr in dir(cls):
        if attr.endswith('_EXTENSION'):
            ext_types.add(getattr(cls, attr))
    return ext_types