assmutils
Utilities to load and manage assemblies.
Attributes
mlogger = logger.get_logger(__name__)
module-attribute
Classes
Functions
load_asm(asm_name)
Load assembly by name into current domain.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
asm_name |
str
|
assembly name |
required |
Returns:
Type | Description |
---|---|
Any
|
the loaded assembly, None if not loaded. |
Source code in pyrevitlib/pyrevit/coreutils/assmutils.py
load_asm_file(asm_file)
Load assembly by file into current domain.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
asm_file |
str
|
assembly file path |
required |
Returns:
Type | Description |
---|---|
Any
|
loaded assembly, None if not loaded. |
Source code in pyrevitlib/pyrevit/coreutils/assmutils.py
load_asm_files(asm_files)
Load assemblies by file into current domain.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
asm_files |
list[str]
|
list of assembly file paths |
required |
find_loaded_asm(asm_info, by_partial_name=False, by_location=False)
Find loaded assembly based on name, partial name, or location.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
asm_info |
str
|
name or location of the assembly |
required |
by_partial_name |
bool
|
returns all assemblies that has the asm_info |
False
|
by_location |
bool
|
returns all assemblies matching location |
False
|
Returns:
Type | Description |
---|---|
list
|
List of all loaded assemblies matching the provided info If only one assembly has been found, it returns the assembly. None will be returned if assembly is not loaded. |
Source code in pyrevitlib/pyrevit/coreutils/assmutils.py
find_type_by_name(assembly, type_name)
Find type by name in assembly.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
assembly |
Assembly
|
assembly to find the type in |
required |
type_name |
str
|
type name |
required |
Returns:
Type | Description |
---|---|
type
|
type if found. |
Raises:
Type | Description |
---|---|
PyRevitException
|
if type not found. |