Hello scripting gurus,
Was looking for a script to invoke the “measure floater” by bypassing the utilities panel and found this one from Bobo, which is a few versions old and doesnt seem to be working on 2016. Since I dont know squat about maxscript, would anyone be kind enough to take a look a it and tell me how to fix it?
[I]macroScript OpenMeasureFloater
category:“Forum Help”
buttontext:“Measure!”
tooltip:“Open the Measure Floater with one click!”
(
fn openMeasureFloater =
(
WM_SETREDRAW=0xB
commandHWND = windows.getChildHWND #max “Command Panel”
windows.sendmessage commandHWND[1] WM_SETREDRAW 0 0
local result = false --flag for success/failure
local oldPannel = getCommandPanelTaskMode() --remember the old command panel tab
UtilityPanel.OpenUtility measure --open Utility tab and enable Measure Utility
local theMeasureUtil = windows.getChildHWND #max “Measure” --grab the Measure’s rollout handle
if theMeasureUtil.count > 0 do --if it was found,
(
local theButton = windows.getChildHWND theMeasureUtil[7] “New Floater” --get the New Floater button’s handle
print theButton
if theButton.count > 0 do --if this succeeded too, then send messages to click it
(
Windows.sendMessage theButton[1] 0x201 0 0 --Left Mouse Button Down
Windows.sendMessage theButton[1] 0x202 0 0 --Left Mouse Button Up
result = true --raise the flag for success
)
)
setCommandPanelTaskMode oldPannel --switch back to the previous command panel tab
windows.sendmessage commandHWND[1] WM_SETREDRAW 1 0
result --return result
)
openMeasureFloater()
)
[/I]
Huge thanks!