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