Open the Measure Floater with one click

Hi,
Is it possible to do this?
And without changing to Utilities Panel?
Just Measure Panel with Lock Selection On...

Or some other method do get live dimensions..?

I've checked miauu's tools, but they are to complex and not free...

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
squeakybadger's picture

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.

(
	(
 
	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 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
 
	(
	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
	result --return result
	)
 
	openMeasureFloater()
 
	)
)
jahman's picture

.

Sure it is possible.

(
 
	local mode = GetCommandPanelTaskMode()
	local subobjlvl = subObjectLevel
 
	UtilityPanel.OpenUtility Measure
	local commandPanelHwnd = (windows.getchildhwnd #max "Command Panel")[1]
	local childs = windows.getChildrenHWND commandPanelHwnd
	local newFloaterBtnHwhd
 
	for c in childs do ( 
 
		if c[4] == "Button" and c[5] == "New Floater" then newFloaterBtnHwhd = c[1] else 
		if c[4] == "Button" and c[5] == "Lock Selection" do (
 
			windows.sendMessage c[1] 0x201 1 0
			windows.sendMessage c[1] 0x202 0 0
 
		)
 
	)
	if newFloaterBtnHwhd != undefined do UIAccessor.PressButton newFloaterBtnHwhd
 
	SetCommandPanelTaskMode mode
	if subobjlvl != undefined do try ( subObjectLevel = subobjlvl )catch()
 
)
piotrglabski's picture

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
---------------------------

jahman's picture

.

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.

piotrglabski's picture

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

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.