Force position of dialog on 2nd display

Hi,

I have some questions on how to work with a two displays setup.
I like to know how i can force a floating dialog to pop up on the same display as my active Max file is on.

My left display is the "main" window, so my dialog is in the left upper corner with "pos 0 0. Only because it is already my "main" display.

How can i force the dialog to be on pos 0 0 if my active max file is on the other display?
I want my dialog to be pos 0 0 too but then on the second display.

I'm guessing that the underneath url is the answer but i have a hard time to understand it and use it. Hoping for some help. Thanks :)

http://help.autodesk.com/view/3DSMAX/2015/ENU/?guid=__files_GUID_282F32A...

Comments

Comment viewing options

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

*

I’ll try it out immediately Monday. Thanks! :)

miauu's picture

.

Since my left monitor is secondary the script works for me. You have to modified it to works for you setup.
The script will works properly if the screen resolution of both monitors is the same. Otherwise you should do one more modifiation of the code.

(
	global rol_test
	try(destroyDialog rol_test)catch()
	rollout rol_test ""
	(
		button btn_move "MOVE" width:140
		button btn_close "Close" width:140
 
		on btn_move pressed do
		(
			desktopSize = sysInfo.desktopSize
			desktopWidth = desktopSize[1] * 0.5
			--	"this works for me - right monitor is main"
-- 			SetDialogPos rol_test [0 - desktopWidth,0]
			--	"this sould work for you - left monitor is main"
			SetDialogPos rol_test [0 + desktopWidth,0]
		)
 
		on btn_close pressed do
		(
			destroyDialog rol_test
		)
 
		on rol_test open do
		(
			SetDialogPos rol_test [0,0]
		)
	)
	createdialog rol_test 	500 400
)
remykonings's picture

.

Maybe i'm doing something wrong but this script doesn't look at the active max file right to determain where the dialogs will pop up?

I like the dialog to pop up on the display which has the active max file. So when my Max is active on the right display. That the dialog will popup at 0.0 on the right display but when my max is active on my left display, that the dialog then will popup on at 0.0 on the left display.

Thank you
Remy

remykonings's picture

*

I would like to use this on all of our companies computers. We use a network toolbar so everyone can use the scripts. Everyone have 2 displays but the main display is sometimes right and sometimes left.

Is there a way to auto-detect this so the above script can be used by everyone?

Thanks you :)

miauu's picture

.

Check this: https://stackoverflow.com/questions/49211585/is-there-any-way-to-check-w...

It is not a solution but can give you some ideas. For example in all computers you(or the guys which uses the PC) will create a txt file in C:. In this txt file it will be written "left" or "right" to indicate the primary monitor. You will modify the script to read this txt file and to place the rollouts properly.

Comment viewing options

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