-
Notifications
You must be signed in to change notification settings - Fork 18
pytha.apply_edge_banding
Applies an edge banding to the edges of a plate.
Similar to the Workshop -> Edge banding -> Assign function in the PYTHA user interface, but without the dialog. Unlike apply_edge_banding_automatic, which applies a configured automatic to whole parts, this function bands the edges you name, with the material you name.
pytha.apply_edge_banding(target, material [,options])| Parameter | Type | Description |
|---|---|---|
target |
element_handle or {...}
|
A part or group handle (or a table of those), or a list of edge specifications |
material |
material_handle or path handle
|
The edge banding material: a material of the project, or a path handle of a material in a material library |
options |
{...} |
Optional: a table that may contain the following options: |
options.thickness |
number |
Thickness of the edge banding |
options.price |
number |
Price of the edge banding |
options.cut_size_is_finished |
boolean |
true if the cut size of the part already is the finished size ("Cut size = Dimension") |
options.pen |
number |
Pen the edge banding line is drawn with; defaults to the pen configured for edge banding |
options.order |
boolean or number
|
false switches the machining order off, a number sets the first order number to use |
| Type | Description |
|---|---|
number |
The number of edges that were banded |
A part or group handle bands every edge of those plates that can carry an edge banding, and assigns no machining order:
local n = pytha.apply_edge_banding(part, material)A list of edge specifications bands exactly those edges, and the list order becomes the machining order within each part:
local n = pytha.apply_edge_banding({
{ {0, 0, 19}, {600, 0, 19}, part },
{ {0, 400, 19}, {600, 400, 19}, part },
}, material)- The edge on the opposite large face of the plate is always banded along with the edge you name. It is not counted in the return value.
- Only edges of the two largest faces of a plate can carry an edge banding. Coordinates without an edge, edges that belong to another face, and machining parts (drillings, grooves, milling) are skipped silently.
- Thickness and price are only needed as long as the material does not carry them itself.
- Applying an edge banding twice to the same part in two calls restarts the machining order at 1. Use
options.orderwith the next free number to continue instead. - A material handle has to belong to the current project (
find_material,enumerate_materials,get_element_material,create_material). To use a material that is not in the project yet, pass the path handle ofpyux.select_material— the material is imported when the banding is applied. - The function requires the Edge banding license, test for it with
check_license_edge_banding.
Let the user pick an edge banding and apply it to the whole plate:
local material = pyux.select_material()
if material then
local n = pytha.apply_edge_banding(part, material, { thickness = 2.0, pen = 12 })
pyui.alert(string.format("%d edges banded", n))
endMinimum PYTHA Version: V27
pytha, Workshop Functions, Edge Specification, remove_edge_banding, apply_edge_banding_automatic, pyux.select_material