PDA

View Full Version : Display World Axis toggle


Ravenslayer
06-10-2011, 06:36 PM
hey guys

does anyone know how i can acces the "Display World Axis" in maxscript.
I would like to disable the axis for my viewportcapture script but i can't seem to find a function.

so i mean this icon has to be hidden using maxscript

http://www.kxcad.net/autodesk/3ds_max/Autodesk_3ds_Max_9_Reference/graphics/ill_world_axis.gif

tnx

lo
06-12-2011, 10:37 AM
I don't believe it is exposed to maxscript. If you must turn it off you will probably need to use UIAccessor.

See this post for an example of the structure of the script you will need:

http://forums.cgsociety.org/showpost.php?p=6991830&postcount=6

Ravenslayer
06-12-2011, 12:06 PM
It's a workaround but i get what you are doing ^^

here's the updated code , tnx a lot :)


struct ShowWorldAxisStr
(
fn setCheckBoxState hwnd state =
(
local BN_CLICKED =0
local BM_SETCHECK = 241
local WM_COMMAND = 273

local parent = UIAccessor.getParentWindow hwnd
local id = UIAccessor.getWindowResourceID hwnd

windows.sendMessage hwnd BM_SETCHECK (if state then 1 else 0) 0
windows.sendMessage parent WM_COMMAND ((bit.shift BN_CLICKED 16) + id) hwnd
ok
),

fn getButtonHwnd hnd =
(
for i in (windows.getChildrenHWND hnd) where matchPattern i[5] pattern:"Display World*" do return i[1]
0
),
fn ChangeTab hnd =
(
TCM_SETCURFOCUS = 0x1330
for kidHWND in (UIAccessor.GetChildWindows hnd) where ((UIAccessor.GetWindowClassName kidHWND) == "SysTabControl32") do
(
UIAccessor.SendMessage kidHWND TCM_SETCURFOCUS 2 0
)
),
fn ShowWorldAxisOn =
(
local hnd = dialogmonitorops.getwindowhandle()
ShowWorldAxisStr.ChangeTab hnd
ShowWorldAxisStr.setCheckBoxState (ShowWorldAxisStr.getButtonHwnd hnd) on
uiaccessor.pressButtonByName hnd "OK"
true
),

fn ShowWorldAxisOff =
(
local hnd = dialogmonitorops.getwindowhandle()
ShowWorldAxisStr.ChangeTab hnd
ShowWorldAxisStr.setCheckBoxState (ShowWorldAxisStr.getButtonHwnd hnd) off
uiaccessor.pressButtonByName hnd "OK"
true
),

fn ShowWorldAxis state =
(
DialogMonitorOPS.unRegisterNotification id:#ShowWorldAxis
DialogMonitorOPS.enabled = off
DialogMonitorOPS.enabled = on
DialogMonitorOPS.RegisterNotification (if state then ShowWorldAxisStr.ShowWorldAxisOn else ShowWorldAxisStr.ShowWorldAxisOff) id:#ShowWorldAxis
actionMan.executeAction 0 "40108"
DialogMonitorOPS.unRegisterNotification id:#ShowWorldAxis
DialogMonitorOPS.enabled = off
)
)

ShowWorldAxisStr.ShowWorldAxis on

CGTalk Moderation
06-12-2011, 12:06 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.