Skip to content

asmmaker

Assembly maker module.

Attributes

ExtensionAssemblyInfo = namedtuple('ExtensionAssemblyInfo', ['name', 'location', 'reloading']) module-attribute

mlogger = logger.get_logger(__name__) module-attribute

Functions

create_assembly(extension)

Create an extension assembly.

Parameters:

Name Type Description Default
extension Extension

pyRevit extension.

required

Returns:

Type Description
ExtensionAssemblyInfo

assembly info

Source code in pyrevitlib/pyrevit/loader/asmmaker.py
def create_assembly(extension):
    """Create an extension assembly.

    Args:
        extension (pyrevit.extensions.components.Extension): pyRevit extension.

    Returns:
        (ExtensionAssemblyInfo): assembly info
    """
    mlogger.debug('Creating assembly for extension: %s', extension.name)
    # create assembly file and return assembly path to be used in UI creation
    # try:
    ext_asm_info = _produce_asm_file(extension)
    mlogger.debug('Assembly created: %s', ext_asm_info)
    return ext_asm_info

cleanup_assembly_files()

Source code in pyrevitlib/pyrevit/loader/asmmaker.py
def cleanup_assembly_files():
    if coreutils.get_revit_instance_count() == 1:
        for asm_file_path in appdata.list_data_files(file_ext='dll'):
            if not assmutils.find_loaded_asm(asm_file_path, by_location=True):
                appdata.garbage_data_file(asm_file_path)
                asm_log_file = asm_file_path.replace('.dll', '.log')
                if op.exists(asm_log_file):
                    appdata.garbage_data_file(asm_log_file)