close caddy menu
Hi, I am making optimization for connecting edges on mose movement. But dont know how to close caddy dialog. Previously I used "UIAccessor.CloseDialog t[1]", but it stoped working, you will find it in a full script bellow. How can I close this caddy menu? Thanks.
macroScript connectPreview_ category:"paulius3d" buttonText:"connectPreview" tooltip:"_connectPreview" -- CONNECT PREVIEW
(
local kasPazymeta
startPosX = mouse.pos.x
startPosY = mouse.pos.y
--print startPos
if $ != undefined and classof $ == Editable_Poly then( -- ar editPoly
if subobjectLevel == 2 then( -- ar Edge
if (polyOp.getEdgeSelection $) as string == (#{}) as string then( --ar pazymeta edge
messagebox "select edge/edges"
)else()
tool foo(
on mousePoint clickno do( -- ant paspaudimo darom
if clickno <= 2 then(
macros.run "paulius3d" "connectGrip_"
for child in (windows.getChildrenHWND 0 parent:#max) where (child[5] == "Connect Edges") do( -- dialogo pozicija ties 0
windPosAndSize = windows.getWindowPos child[1]
windows.setWindowPos child[1] 0 0 windPosAndSize.w windPosAndSize.h true
)
)else (
$.EditablePoly.ConnectEdges ()
t = windows.getChildHWND 0 "Connect Edges"
DestroyDialog t[1]
--UIAccessor.CloseDialog t[1]
#stop
)
)
on mouseMove clickno do(
try(
$.connectEdgeSlide = ((viewPoint.x - startPosX)/3)
$.connectEdgeSegments = (1+abs((viewPoint.y - startPosY-100)/300))
)catch false
)
on mouseAbort clickno do(
try(
t=windows.getChildHWND 0 "Connect Edges"
--UIAccessor.CloseDialog t[1]
)catch false
)
)
startTool foo
)
else(
subobjectLevel = 2
messagebox "make edge selection and run again"
)
)else messagebox "select Editable poly"
)
Comments
Hi, thanks for taking time to
Hi, thanks for taking time to check my problem. Yes, caddy dialog appears when I am trying to run macro to have connect dialog (connectGrip_). I know I could use old style connect dialog, but For other places, like extrude, bridge and so on, I quite like caddy menu. Just wondering is there is a simple command to close that dialog.
www.ink.lt
.
Can you post the connectGrip_ so we can see the code?
Tools and Scripts for Autodesk 3dsMax
Hi, I have replaced that
Hi, I have replaced that macro to default macros, that shoud run on any 3ds max system. The script works as follow: If you have Editable Poly selected, in Edges subobjectt level. You have to select one edge and run the script. First macro selects the ring of edges, the second macro runs connect function. Later new edges move according to mouse movement, horizontaly shifts them to the sides, if you move verticaly, that adds some extra edges. Because of the mouse movement, you have to run this script as maxro, and assign the shortcut, as the mouse initial position matters. You can download as script file here:
https://mega.nz/#!LyYUGYSJ!H26F_vidiRFNNI31JcKyrEG2w4GcYMofFoIAUa6kIfo
or copy from bellow. Thanks a lot.
macroScript connectPreview_ category:"paulius3d" buttonText:"connectPreview" tooltip:"_connectPreview" -- CONNECT PREVIEW
(
local kasPazymeta
startPosX = mouse.pos.x
startPosY = mouse.pos.y
--print startPos
if $ != undefined and classof $ == Editable_Poly then( -- ar editPoly
if subobjectLevel == 2 then( -- ar Edge
if (polyOp.getEdgeSelection $) as string == (#{}) as string then( --ar pazymeta edge
messagebox "select edge/edges"
)else()
tool foo(
on mousePoint clickno do( -- ant paspaudimo darom
if clickno <= 2 then(
macros.run "Editable Polygon Object" "EPoly_Select_Ring"
macros.run "Ribbon - Modeling" "ConnectEdgesOptions"
for child in (windows.getChildrenHWND 0 parent:#max) where (child[5] == "Connect Edges") do( -- dialogo pozicija ties 0
windPosAndSize = windows.getWindowPos child[1]
windows.setWindowPos child[1] 0 0 windPosAndSize.w windPosAndSize.h true
)
)else (
$.EditablePoly.ConnectEdges ()
t = windows.getChildHWND 0 "Connect Edges"
DestroyDialog t[1]
--UIAccessor.CloseDialog t[1]
#stop
)
)
on mouseMove clickno do(
try(
$.connectEdgeSlide = ((viewPoint.x - startPosX)/3)
$.connectEdgeSegments = (1+abs((viewPoint.y - startPosY-100)/300))
)catch false
)
on mouseAbort clickno do(
try(
t=windows.getChildHWND 0 "Connect Edges"
--UIAccessor.CloseDialog t[1]
)catch false
)
)
startTool foo
)
else(
subobjectLevel = 2
messagebox "make edge selection and run again"
)
)else messagebox "select Editable poly"
)
www.ink.lt
.
I can't find a solution. Sorry.
Tools and Scripts for Autodesk 3dsMax
.
No problem, thanks for taking time ;)
www.ink.lt
`
Sorry it might be late, but did you try to print if there is any windows found with "Collect Edges"
Try to add:
print t.count
or:
messageBox t.count
after:
t = windows.getChildHWND 0 "Connect Edges"
Best,
Pixamoon
*
That didn't work. Caddy is some kind of "not window" type dialog.
www.ink.lt
.
Try this one.
But note that for some reason there's no resulting edges selection in caddy mode.
and
caddy is absolutely a window
see for yourself
ok, apply and cancel buttons have 22x22 dimensions in my 2014 max, don't know if it's the case for all the rest. But anyway, knowing control position you can find its handle pretty easily
btw. you can use Spy++ to check what messages are sent to any max control
*
I tried your script, but it doesnt work on 3dsmax 2018
t: undefined
--qtwidgets: #()
--button_hwnd: undefined
Tried couple of modifications, and still didnt find a solution. Also installed spy++, played with it a bit and also didnt find a solution, or required "line" to solve that. For now I am using this script, that works well when disabling caddy controls, but as I mentioned previosly I quite like caddy controls in overal.
ps. dont know how to insert a script here properly :(
script
macroScript connectPreview_ category:"paulius3d" buttonText:"connectPreview" tooltip:"_connectPreview" -- CONNECT PREVIEW
(
local kasPazymeta
startPosX = mouse.pos.x
startPosY = mouse.pos.y
--print startPos
if $ != undefined and classof $ == Editable_Poly then( -- ar editPoly
if subobjectLevel == 2 then( -- ar Edge
if (polyOp.getEdgeSelection $) as string == (#{}) as string then( --ar pazymeta edge
messagebox "select edge/edges"
)else()
tool foo(
on mousePoint clickno do( -- ant paspaudimo darom
if clickno <= 2 then(
macros.run "Editable Polygon Object" "EPoly_Select_Ring"
macros.run "Ribbon - Modeling" "ConnectEdgesOptions"
for child in (windows.getChildrenHWND 0 parent:#max) where (child[5] == "Connect Edges") do( -- dialogo pozicija ties 0
windPosAndSize = windows.getWindowPos child[1]
windows.setWindowPos child[1] 0 0 windPosAndSize.w windPosAndSize.h true
)
)else (
$.EditablePoly.ConnectEdges ()
try(
uiaccessor.closedialog (windows.getchildhwnd 0 "Connect Edges")[1]
)catch false
#stop
)
)
on mouseMove clickno do(
try(
$.connectEdgeSlide = ((viewPoint.x - startPosX)/3)
$.connectEdgeSegments = (1+abs((viewPoint.y - startPosY-100)/300))
)catch false
)
on mouseAbort clickno do(
try(
uiaccessor.closedialog (windows.getchildhwnd 0 "Connect Edges")[1]
)catch false
)
)
startTool foo
)
else(
subobjectLevel = 2
messagebox "make edge selection and run again"
)
)else messagebox "select Editable poly"
)
www.ink.lt
.
<code> ... code goes here ... </code>
but I won't be able to help you with anything above 2014 anyway