ScriptSpot is a diverse online community of artists and developers who come together to find and share scripts that empower their creativity with 3ds Max. Our users come from all parts of the world and work in everything from visual effects to gaming, architecture, students or hobbyists.
This is what I have been using to open the Measuretool Floater for a while. Works in max 2018 & 2019.
No idea how to get it to start with the selection lock option enabled though! I'm sure I found it on scriptspot though.
((
fn openMeasureFloater =
(
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 handleif theMeasureUtil.count > 0 do--if it was found, (
local theButton = windows.getChildHWND theMeasureUtil[7]"New Floater"--get the New Floater button's handle(
Windows.sendMessage theButton[1] 0x201 00--Left Mouse Button Down
Windows.sendMessage theButton[1] 0x202 00--Left Mouse Button Up
result = true--raise the flag for success))
setCommandPanelTaskMode oldPannel --switch back to the previous command panel tab
result --return result)
openMeasureFloater()))
Thanks for that.
The script takes me to, and opens, the Measure Tab. But it doesn't create a New Floater.
Ideally I want to open a New (Measure) Floater and place it to a particular place on the screen.
it was written for older max versions, so it doesn't work in QT interface
change it like that and it will work as expected
...
hwnd = (windows.getChildHWND #max "Lock Selection")[1]
state = windows.sendMessage hwnd 0xF0 00-- check if locked selection state is activeif state != 1 do(
windows.sendMessage hwnd 0x201 10
windows.sendMessage hwnd 0x202 00)
UIAccessor.PressButton (windows.getChildHWND #max "New Floater")[1]-- position Measure window at certain coord(dotNetClass "Autodesk.Max.GlobalInterface").Instance.SlideWindow (for w in UIAccessor.GetPopupDialogs() collect w)[1]100100
...
I guess I've seen this script already somewhere - and I remember the same error...
It switches to Utility panel, but nothing more...
Max 2019...
---------------------------
MAXScript MacroScript Error Exception
---------------------------
-- No ""get"" function for undefined
---------------------------
OK
---------------------------
It was written yesterday so it's unlikely. :) But many scripts use similar approach to handle UI.
Maybe someone who have max2019 installed could help you modifying it to work.
I guess you noticed that AD changed max UI pretty heavily, and that's the main reason why some scripts can't work in new versions as expected.
You were most helpful anyway, than you for your help.
I wish I had programming skills - I see how much can be easier and better in 3Dmax with MaxScript, I've try to learn so many times, but I'm litte "slow" in that matter.
(I've try your script also in 3DMax2018, same error)
(
local mode = GetCommandPanelTaskMode()
local subobjlvl = subObjectLevel
UtilityPanel.OpenUtility Measure
hwnd = (windows.getChildHWND #max "Lock Selection")[1]
state = windows.sendMessage hwnd 0xF0 00-- check if locked selection state is activeif state != 1 do(
windows.sendMessage hwnd 0x201 10
windows.sendMessage hwnd 0x202 00)
UIAccessor.PressButton (windows.getChildHWND #max "New Floater")[1]-- position Measure window at certain coord(dotNetClass "Autodesk.Max.GlobalInterface").Instance.SlideWindow (for w in UIAccessor.GetPopupDialogs() collect w)[1] 100 100
SetCommandPanelTaskMode mode
if subobjlvl != undefined dotry( subObjectLevel = subobjlvl )catch())
Test it in max 2019 and if the error occur - post here the full error message. Most probably the line in which the error happens will be written in it.
Comments
This is what I have been
This is what I have been using to open the Measuretool Floater for a while. Works in max 2018 & 2019.
No idea how to get it to start with the selection lock option enabled though! I'm sure I found it on scriptspot though.
.
Sure it is possible.
Open Measure Floater New Floater.
Thanks for that.
The script takes me to, and opens, the Measure Tab. But it doesn't create a New Floater.
Ideally I want to open a New (Measure) Floater and place it to a particular place on the screen.
How can I do that?
Thanks again
Graham
.
it was written for older max versions, so it doesn't work in QT interface
change it like that and it will work as expected
I guess I've seen this script
I guess I've seen this script already somewhere - and I remember the same error...
It switches to Utility panel, but nothing more...
Max 2019...
---------------------------
MAXScript MacroScript Error Exception
---------------------------
-- No ""get"" function for undefined
---------------------------
OK
---------------------------
.
It was written yesterday so it's unlikely. :) But many scripts use similar approach to handle UI.
Maybe someone who have max2019 installed could help you modifying it to work.
I guess you noticed that AD changed max UI pretty heavily, and that's the main reason why some scripts can't work in new versions as expected.
You were most helpful anyway,
You were most helpful anyway, than you for your help.
I wish I had programming skills - I see how much can be easier and better in 3Dmax with MaxScript, I've try to learn so many times, but I'm litte "slow" in that matter.
(I've try your script also in 3DMax2018, same error)
Piotr
.
This works in max 2020:
Test it in max 2019 and if the error occur - post here the full error message. Most probably the line in which the error happens will be written in it.
Tools and Scripts for Autodesk 3dsMax