Skip to content

framework

Provide access to DotNet Framework.

Examples:

from pyrevit.framework import Assembly, Windows

Attributes

ASSEMBLY_FILE_TYPE = 'dll' module-attribute

ASSEMBLY_FILE_EXT = '.dll' module-attribute

ipy_assmname = '{prefix}IronPython'.format(prefix=eng.EnginePrefix) module-attribute

ipy_dllpath = op.join(eng.EnginePath, ipy_assmname + ASSEMBLY_FILE_EXT) module-attribute

wpf_assmname = '{prefix}IronPython.Wpf'.format(prefix=eng.EnginePrefix) module-attribute

wpf_dllpath = op.join(eng.EnginePath, wpf_assmname + ASSEMBLY_FILE_EXT) module-attribute

sqlite3_assmname = '{prefix}IronPython.SQLite'.format(prefix=eng.EnginePrefix) module-attribute

sqlite3_dllpath = op.join(eng.EnginePath, sqlite3_assmname + ASSEMBLY_FILE_EXT) module-attribute

Functions

get_type(fw_object)

Return CLR type of an object.

Source code in pyrevitlib/pyrevit/framework.py
def get_type(fw_object):
    """Return CLR type of an object."""
    return clr.GetClrType(fw_object)

get_dll_file(assembly_name)

Return path to given assembly name.

Source code in pyrevitlib/pyrevit/framework.py
def get_dll_file(assembly_name):
    """Return path to given assembly name."""
    addin_file = op.join(BIN_DIR, assembly_name + '.dll')
    if op.exists(addin_file):
        return addin_file

get_current_thread_id()

Return manageed thread id of current thread.

Source code in pyrevitlib/pyrevit/framework.py
def get_current_thread_id():
    """Return manageed thread id of current thread."""
    return System.Threading.Thread.CurrentThread.ManagedThreadId