pytha.copy_element - pytha-3d-cad/pytha-lua-api GitHub Wiki

Copies a single element or a table of elements by a given distance.

Similar to the Part Tools I -> Copy function in the PYTHA user interface.

pytha.copy_element(element, distance [,copies]) 
Parameter Type Description
element element_handle or {...} A single element handle or a table of element handles
distance {x,y,z} Displacement of the copy in x,y,z
copies integer Optional: number of copies (default: 1)

Return value

Type Description
{element_handle, ...} A table containing the element handles of the newly created elements

Additional information

If element contains element handles to groups, all members of these group will be copied as well and the structural hierarchy of the groups will be preserved.

To perform a rotational copy, copy with a distance of {0,0,0} and rotate the returned table with rotate_element

See also:

pytha, Part Tools Functions, Element Handles, move_element, rotate_element, Groups