linkcad.controller
High-level conversion workflow controller. Use this when you need the full conversion wizard state machine (validate, import, transform, export) rather than driving linkcad.conv directly.
from linkcad.controller import ConversionController, ConversionStateClasses
ConversionController
Orchestrates the multi-step conversion workflow used by the LinkCAD conversion wizard.
from linkcad.controller import ConversionController
ctrl = ConversionController()ctrl.set_import_format("GDSII")ctrl.set_export_format("DXF")ctrl.set_import_path("/data/design.gds")ctrl.set_export_path("/data/design.dxf")
ctrl.run()if ctrl.state == ConversionState.Done: print("Conversion succeeded")else: print(f"Failed at state: {ctrl.state}")| Method / Property | Description |
|---|---|
ConversionController() | Create a new controller instance |
ctrl.set_import_format(name) | Set the import format by name (e.g. "GDSII") |
ctrl.set_export_format(name) | Set the export format by name |
ctrl.set_import_path(path) | Set the input file path |
ctrl.set_export_path(path) | Set the output file path |
ctrl.run() | Execute the full conversion pipeline |
ctrl.state | Current ConversionState |
ctrl.drawing() | Returns the loaded Drawing (available after import step) |
ConversionState
Enum representing the current state of the conversion wizard.
| Value | Description |
|---|---|
ConversionState.Idle | Not yet started |
ConversionState.Importing | Import step in progress |
ConversionState.Transforming | Applying layer maps and transformations |
ConversionState.Exporting | Export step in progress |
ConversionState.Done | Completed successfully |
ConversionState.Failed | An error occurred |