Skip to content

pytha.set_x_axis_direction

fabian-flassig edited this page Aug 25, 2026 · 1 revision

Sets the x axis of a plate, the direction a cnc machine aligns the part by.

Similar to the Workshop -> X axis function in the PYTHA user interface. The x axis defines how the part is placed on the machine table; it is independent of the grain direction.

pytha.set_x_axis_direction(edge)
Parameter Type Description
edge {...} An edge specification { {x,y,z}, {x,y,z} [, part_handle] }

Return value

Type Description
element_handle The part the x axis was set on, or nil if neither an edge nor a plate was found

Notes:

  • Works exactly like set_grain_direction, including the free line case: if an edge connects the two coordinates it becomes the x axis edge, otherwise the line is taken as a direction line on the plate it lies on.
  • A plate keeps one x axis. A second call replaces the first.
  • A plate can carry a grain direction and an x axis at the same time; they are separate attributes on separate edges.
  • The function requires the Workshop license, test for it with check_license_workshop.

Example:

pytha.set_x_axis_direction({ {0, 0, 19}, {600, 0, 19}, part })

Version Support:

Minimum PYTHA Version: V27

See also:

pytha, Workshop Functions, Edge Specification, remove_x_axis_direction, set_grain_direction

Clone this wiki locally