Message 1 of 3
batch export script error help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
HI
Im trying to export many objects to STL format. Max does not have a way to batch export to this format or include the object name on export making errors inevitable.
I have found a script here but I think somthing has changed and it no longer works.
http://forums.autodesk.com/t5/programming/stl-batch-export-script-help/td-p/4080787
I recieve error "references only allowed on variable,properties and array indexes"
in line exportFile etc
I have no idea what this error means or how to go about fixing it.
Is the error in the code or the max version or is it me?
thanks a lot for any hlpe
Joe Remainz
macroScript Export_Selected_2_STL category:"ScrewyScripts" tooltip:"Export selected to .STL"
(
global STL_Object_Name = ""
fn SetSTLExportOptions =
(
local BM_GETSTATE = 0xF2
local BM_CLICK = 0xF5
local BM_SETCHECK = 0xF1
local BST_CHECKED = 0x1
WindowHandle = DialogMonitorOPS.GetWindowHandle()
if ((UIAccessor.GetWindowText WindowHandle) == "Export STL File") then
(
children = UIAccessor.GetChildWindows WindowHandle
for i = 1 to children.count do
(
child = children
childTitle = (UIAccessor.GetWindowText child)
if (childTitle == "Object01") then
UIAccessor.SetWindowText child STL_Object_Name
if (childTitle == "Selected only") then
(
cbState = windows.sendMessage child BM_GETSTATE 0 0
checked = bit.get cbState BST_CHECKED
if (checked == false) then
(
windows.sendMessage child BM_CLICK 0 0
windows.sendMessage child BM_SETCHECK 1 0
)
)
)
uiAccessor.sendMessageID WindowHandle #IDOK
)
true
)
DialogMonitorOPS.unRegisterNotification id:#Set_STL_Export_Options
DialogMonitorOPS.RegisterNotification SetSTLExportOptions id:#Set_STL_Export_Options
DialogMonitorOPS.Enabled = true
selected = for obj in selection collect obj
for obj in selected do
(
STL_Object_Name = obj.name
select obj
exportFile ((getDir #export) + "/" + STL_Object_Name + ".stl")
)
DialogMonitorOPS.Enabled = false
DialogMonitorOPS.unRegisterNotification id:#Set_STL_Export_Options
)