Share

Script1_MeshSimpleOperations.lua

-- Lua example for Autodesk Netfabb 2019.0

-- Accesses the current tray and moves and scales its parts
-- Requires 

system:setloggingtooglwindow(true)

-- Get root meshgroup from tray
root = tray.root
system:log('Tray has ' .. tostring(root.meshcount) .. ' parts')

translate = 150
scale     = 0.5

-- Iterate part in group
for mesh_index = 0, root.meshcount - 1 do
    local mesh = root:getmesh(mesh_index)

    -- translate part
    mesh:translate(translate, 0, translate) --translate in X and Z
    mesh:scale(scale, scale, scale) -- scale proportionally
end

Was this information helpful?