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

Imports a .pyo file into the project.

Similar to the File-> Import function in the PYTHA user interface.

pytha.import_pyo(file [,origin [,options [,parametrics]]]) 
Parameter Type Description
file file_handle A handle to a .pyo file
origin {x,y,z} Optional: origin point where part is placed
options {...} Optional: a table that may contain the following options:
options.u_axis {x,y,z} Local coordinate u-axis for the orientation of file
options.v_axis {x,y,z} Local coordinate v-axis for the orientation of file
options.w_axis {x,y,z} Local coordinate w-axis for the orientation of file
parametrics {...} Table of parametrics with the key as the parametric specifier and the value as the value

The file handle has to be retreived via select_pyo.

origin defines a relative offset of file to its original position. If not specified or an empty table is passed the imported parts will keep their original position.

The axes specified in options define the orientation of file, relative to the coordinate origin. If not specified or an empty table is passed the imported parts will keep their original orientation. Any non-orthonormal axes will be orthogonalized and normalized.

The keys of the parametrics table must be matching the names of the parametric dimensions in file, otherwise the key-value pair is ignored. If file contains no parametrics, the parametrics table is ignored. If file contains parametrics not matching any key in the parametrics table, PYTHA will prompt a user input for this value.

Return value

Type Description
{element_handle, ...} A table containing the element handles of the newly imported parts

See also:

pytha, Axes and directions, open_pyo, select_pyo, list_pyos