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

Comment viewing options

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

.

Which line of your code is used to show the caddy dialog? This one: macros.run "paulius3d" "connectGrip_" or another?

Whay you not switch to old style dialogs, not to caddy?

Comment viewing options

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