Skip to content

Machine Controller

CNC and woodworking-machine output.

Covers the calculation and export of machine data for fabrication: BTL / BTLx in their supported versions, the Hundegger family and its variants (with optional preset files and silent operation), and the inspection of per-element machine processings. The bridge between the cadwork model and the shop floor.

calculate_btl_machine_data(element_id_list: list[ElementId], btl_version: btl_version) -> None

Calculates the Machine Data for BTL.

Parameters:

Name Type Description Default
element_id_list list[ElementId]

The list of element Id.

required
btl_version btl_version

The BTL version.

required

Examples:

1
2
3
>>> import cadwork
>>> import element_controller as ec
>>> import machine_controller as mc
1
2
3
>>> beam_elements = ec.get_all_identifiable_element_ids()
>>> btl_version = cadwork.btl_version.btlx_2_1.value
>>> mc.calculate_btl_machine_data(beam_elements, btl_version)

calculate_hundegger_machine_data(element_id_list: list[ElementId], hundeggertype: hundegger_machine_type) -> None

Calculates the Machine Data for Hundegger.

Parameters:

Name Type Description Default
element_id_list list[ElementId]

The list of element Id.

required
hundeggertype hundegger_machine_type

The Hundegger machine type.

required

Examples:

1
2
3
>>> import cadwork
>>> import element_controller as ec
>>> import machine_controller as mc
1
2
3
>>> beam_elements = ec.get_all_identifiable_element_ids()
>>> hundegger_type = cadwork.hundegger_machine_type.k2.value
>>> mc.calculate_hundegger_machine_data(beam_elements, hundegger_type)

export_btl(btl_version: btl_version, file_path: str) -> None

Exports a BTL file.

Parameters:

Name Type Description Default
btl_version btl_version

The BTL version.

required
file_path str

The export file path.

required

Examples:

1
2
>>> import cadwork
>>> import machine_controller as mc
1
2
3
>>> btl_version = cadwork.btl_version.btlx_2_1.value
>>> output_path = "C:/exports/timber_project.btlx"
>>> mc.export_btl(btl_version, output_path)

export_btl_with_presetting(btl_version: btl_version, file_path: str, presetting: str) -> None

Exports a BTL file with a presetting file.

Parameters:

Name Type Description Default
btl_version btl_version

The BTL version.

required
file_path str

The export file path.

required
presetting str

The presetting file path (.xml).

required

Examples:

1
2
>>> import cadwork
>>> import machine_controller as mc
1
2
3
4
>>> btl_version = cadwork.btl_version.btlx_2_1.value
>>> output_path = r"C:/exports/timber_project.btlx"
>>> presetting_file = r"...3d/Machine/BTL/btl_settings.xml"
>>> mc.export_btl_with_presetting(btl_version, output_path, presetting_file)

export_hundegger(hundeggertype: hundegger_machine_type) -> None

Exports a Hundegger file.

Parameters:

Name Type Description Default
hundeggertype hundegger_machine_type

The Hundegger machine type.

required

Examples:

1
2
>>> import cadwork
>>> import machine_controller as mc
1
2
>>> hundegger_type = cadwork.hundegger_machine_type.k2.value
>>> mc.export_hundegger(hundegger_type)

export_hundegger_with_file_path(hundeggertype: hundegger_machine_type, file_path: str) -> None

Exports a Hundegger file.

Parameters:

Name Type Description Default
hundeggertype hundegger_machine_type

The Hundegger machine type.

required
file_path str

The export file path.

required

Examples:

1
2
>>> import cadwork
>>> import machine_controller as mc
1
2
3
>>> hundegger_type = cadwork.hundegger_machine_type.k2.value
>>> output_path = "C:/exports/hundegger_project.k2"
>>> mc.export_hundegger_with_file_path(hundegger_type, output_path)

export_hundegger_with_file_path_and_presetting(hundeggertype: hundegger_machine_type, file_path: str, presetting: str) -> None

Exports a Hundegger file.

Parameters:

Name Type Description Default
hundeggertype hundegger_machine_type

The Hundegger machine type.

required
file_path str

The export file path.

required
presetting str

The presetting file path (.xml).

required

Examples:

1
2
>>> import cadwork
>>> import machine_controller as mc
1
2
3
4
>>> hundegger_type = cadwork.hundegger_machine_type.k2.value
>>> output_path = r"C:/exports/hundegger_project.k2"
>>> presetting_file = r"...3d/Machine/Hundegger/K2/hundegger_settings.xml"
>>> mc.export_hundegger_with_file_path_and_presetting(hundegger_type, output_path, presetting_file)

export_hundegger_with_file_path_and_presetting_silent(hundeggertype: hundegger_machine_type, file_path: str, presetting: str) -> None

Exports a Hundegger file silently.

Parameters:

Name Type Description Default
hundeggertype hundegger_machine_type

The Hundegger machine type.

required
file_path str

The export file path.

required
presetting str

The presetting file path (.xml).

required

Examples:

1
2
>>> import cadwork
>>> import machine_controller as mc
1
2
3
4
>>> hundegger_type = cadwork.hundegger_machine_type.k2.value
>>> output_path = r"C:/exports/hundegger_project.k2"
>>> presetting_file = r"...3d/Machine/Hundegger/K2/hundegger_settings.xml"
>>> mc.export_hundegger_with_file_path_and_presetting_silent(hundegger_type, output_path, presetting_file)

export_hundegger_with_file_path_silent(hundeggertype: hundegger_machine_type, file_path: str) -> None

Exports a Hundegger file silently.

Parameters:

Name Type Description Default
hundeggertype hundegger_machine_type

The Hundegger machine type.

required
file_path str

The export file path.

required

Examples:

1
2
>>> import cadwork
>>> import machine_controller as mc
1
2
3
>>> hundegger_type = cadwork.hundegger_machine_type.k2.value
>>> output_path = r"C:/exports/hundegger_project.k2"
>>> mc.export_hundegger_with_file_path_silent(hundegger_type, output_path)

export_weinmann_mfb(mfb_version: weinmann_mfb_version) -> None

Exports a Weinmann MFB file.

Parameters:

Name Type Description Default
mfb_version weinmann_mfb_version

The Weinmann MFB version.

required

Examples:

1
>>> import machine_controller as mc
1
2
>>> mfb_version = cadwork.weinmann_mfb_version.wup_3_4.value
>>> mc.export_weinmann_mfb(mfb_version)

get_element_btl_processings(element_id: ElementId, btl_version: btl_version) -> list[ElementId]

Gets the list of BTL processings for a specific element.

Parameters:

Name Type Description Default
element_id ElementId

The element id.

required
btl_version btl_version

The BTL version.

required

Examples:

1
2
3
>>> import cadwork
>>> import element_controller as ec
>>> import machine_controller as mc
1
2
3
4
>>> element: int = 123456789
>>> btl_version = cadwork.btl_version.btlx_2_1.value
>>> processings = mc.get_element_btl_processings(element, btl_version)
>>> print(f"Found {len(processings)} BTL processings")

Returns:

Type Description
list[ElementId]

A list of element IDs representing the processings.

get_element_hundegger_processings(element_id: ElementId, hundeggertype: hundegger_machine_type) -> list[ElementId]

Gets the list of Hundegger processings for a specific element.

Parameters:

Name Type Description Default
element_id ElementId

The element id.

required
hundeggertype hundegger_machine_type

The Hundegger machine type.

required

Examples:

1
2
3
>>> import cadwork
>>> import element_controller as ec
>>> import machine_controller as mc
1
2
3
4
>>> element: int = 123456789
>>> hundegger_type = cadwork.hundegger_machine_type.k2.value
>>> processings = mc.get_element_hundegger_processings(element, hundegger_type)
>>> print(f"Found {len(processings)} Hundegger processings")

Returns:

Type Description
list[ElementId]

A list of element IDs representing the processings.

get_processing_btl_parameter_set(reference_element_id: ElementId, processing_id: ElementId) -> list[str]

Gets the BTL parameter set of a specific processing.

Parameters:

Name Type Description Default
reference_element_id ElementId

The reference element id.

required
processing_id ElementId

The processing id.

required

Examples:

1
2
3
>>> import cadwork
>>> import element_controller as ec
>>> import machine_controller as mc
1
2
3
4
>>> element: int = 123456789
>>> processings = mc.get_element_btl_processings(element, cadwork.btl_version.btlx_2_1.value)
>>> for processing in processings:
>>>     parameters = mc.get_processing_btl_parameter_set(element, processing)

Returns:

Type Description
list[str]

A list of strings representing the BTL parameter set of the processing.

get_processing_code(reference_element_id: ElementId, processing_id: ElementId) -> str

Gets the code of a specific processing.

Parameters:

Name Type Description Default
reference_element_id ElementId

The reference element id.

required
processing_id ElementId

The processing id.

required

Examples:

1
2
3
>>> import cadwork
>>> import element_controller as ec
>>> import machine_controller as mc
1
2
3
4
>>> element: int = 123456789
>>> processings = mc.get_element_btl_processings(element, cadwork.btl_version.btlx_2_1.value)
>>> for processing in processings:
>>>     code = mc.get_processing_code(element, processing)

Returns:

Type Description
str

The code of the processing.

get_processing_name(reference_element_id: ElementId, processing_id: ElementId) -> str

Gets the name of a specific processing.

Parameters:

Name Type Description Default
reference_element_id ElementId

The reference element id.

required
processing_id ElementId

The processing id.

required

Examples:

1
2
3
>>> import cadwork
>>> import element_controller as ec
>>> import machine_controller as mc
1
2
3
4
>>> element: int = 123456789
>>> processings = mc.get_element_btl_processings(element, cadwork.btl_version.btlx_2_1.value)
>>> for processing in processings:
>>>     name = mc.get_processing_name(element, processing)

Returns:

Type Description
str

The name of the processing.

get_processing_points(reference_element_id: ElementId, processing_id: ElementId) -> vertex_list

Gets the points of a specific processing.

Parameters:

Name Type Description Default
reference_element_id ElementId

The reference element id.

required
processing_id ElementId

The processing id.

required

Examples:

1
2
3
>>> import cadwork
>>> import element_controller as ec
>>> import machine_controller as mc
1
2
3
4
>>> element: int = 123456789
>>> processings = mc.get_element_btl_processings(element, cadwork.btl_version.btlx_2_1.value)
>>> for processing in processings:
>>>     points = mc.get_processing_points(element, processing)

Returns:

Type Description
vertex_list

A list of vertices representing the points of the processing.

load_hundegger_calculation_set(hundeggertype: hundegger_machine_type, file_path: str) -> None

Loads the Hundegger calculation set.

Parameters:

Name Type Description Default
hundeggertype hundegger_machine_type

The Hundegger machine type.

required
file_path str

The file path of the calculation set.

required