Skip to content

Utility Mixin

Low-level helpers shared across all mixins: coordinate normalization, COM VARIANT conversion, color index lookup, and export path resolution.

adapters.mixins.utility_mixin.UtilityMixin

Mixin for utility methods, helpers, and converters.

resolve_export_path

resolve_export_path(
    filename: str, folder_type: str = "drawings"
) -> str

Centralized path resolution for all export operations.

Handles: 1. Configured output directory (from config.json) 2. Subfolder hierarchy (drawings, images, sheets) 3. Tilde expansion and absolute path resolution 4. Security validation (must be within output directory) 5. Directory creation

PARAMETER DESCRIPTION
filename

Name of the file with extension

TYPE: str

folder_type

Subfolder category ('drawings', 'images', 'sheets')

TYPE: str DEFAULT: 'drawings'

RETURNS DESCRIPTION
str

Full absolute path to the resolved file

TYPE: str