pytha.enumerate_parts - pytha-3d-cad/pytha-lua-api GitHub Wiki
Especially for part selector extensions, it is necessary to enumerate all parts:
pytha.enumerate_parts()
This function should be used in a lua for ... in ... do loop as follows:
for part in pytha.enumerate_parts() do
... -- do something with part
end
where part is an element handle.