Skip to content

labs

Wrapper module for pyRevitLabs functionality.

Attributes

mlogger = logger.get_logger(__name__) module-attribute

Functions

extract_build_from_exe(proc_path)

Extract build number from host .exe file.

Parameters:

Name Type Description Default
proc_path str

full path of the host .exe file

required

Returns:

Type Description
str

build number (e.g. '20170927_1515(x64)')

Source code in pyrevitlib/pyrevit/labs.py
def extract_build_from_exe(proc_path):
    """Extract build number from host .exe file.

    Args:
        proc_path (str): full path of the host .exe file

    Returns:
        (str): build number (e.g. '20170927_1515(x64)')
    """
    # Revit 2021 has a bug on .VersionBuild
    ## it reports identical value as .VersionNumber
    pinfo = TargetApps.Revit.RevitProductData.GetBinaryProductInfo(proc_path)
    return "{}({})".format(pinfo.build, pinfo.target) \
        if pinfo.build else "20000101_0000(x64)"