<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Control Loft params from MXS. in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/control-loft-params-from-mxs/m-p/14148219#M29442</link>
    <description>&lt;P&gt;Let's break down your questions:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;fn editSpinner hwnd val = 
(
	WM_CHAR 	= 0x0102
	VK_RETURN 	= 0x000D

	uiaccessor.setwindowtext hwnd (val as string)
	windows.sendMessage hwnd WM_CHAR VK_RETURN 0 -- press ENTER key
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it's how I do it.&lt;/P&gt;</description>
    <pubDate>Sat, 30 May 2026 23:44:00 GMT</pubDate>
    <dc:creator>denisT.MaxDoctor</dc:creator>
    <dc:date>2026-05-30T23:44:00Z</dc:date>
    <item>
      <title>Control Loft params from MXS.</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/control-loft-params-from-mxs/m-p/14147342#M29439</link>
      <description>&lt;P&gt;Hello, fellas.&lt;BR /&gt;&lt;BR /&gt;I want to control Loft's Surface and Skin parameters.&lt;BR /&gt;&lt;BR /&gt;Showproperties only dumps couple of useless things in my case.&lt;BR /&gt;Documentation is not much of a help either, unless I want to deal with SDK. And I don't because I can't.&lt;BR /&gt;Found a way to set checkboxes, not sure how clean or stable it is, but it works.&lt;BR /&gt;&lt;BR /&gt;Spinners defeated me though.&lt;BR /&gt;Setting text to Edit field works, but doesn't stick. If I deselect Loft object and select it again, Length/Width Repeat values are reset.&lt;BR /&gt;Best I got is listed below. Idea was to set "fake" text and then "make it real" by clicking the SpinnerControl.&lt;BR /&gt;Value I set is treated as purely visual and is being overwritten by some internal value + increment from spinner click.&lt;/P&gt;&lt;P&gt;1.0 becomes 1.01 and not 10.01.&lt;BR /&gt;&lt;BR /&gt;max2024&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(
	commandPanelHwnd = windows.getChildHWND #max "Command Panel"
	local allControls = windows.getChildrenHWND commandPanelHwnd[1]
	local WM_LBUTTONDOWN = 0x0201
	local WM_LBUTTONUP   = 0x0202

	for ctrl in allControls do (
		-- ctrl[1] HWND, ctrl[4] class, ctrl[5] text
		if ctrl[5] == "Length Repeat:" then (
			local parentHwnd = UIAccessor.GetParentWindow ctrl[1]
			spinnerControls = (windows.getChildrenHWND parentHwnd)
			for sctrl in spinnerControls do (
				if sctrl[4] == "Edit" then (
					UIAccessor.SetWindowText sctrl[1] "10"
				)
				if sctrl[4] == "SpinnerControl" then (
					--format "%\t%\t%\n" sctrl[1] sctrl[4] sctrl[5]
					windows.sendMessage sctrl[1] WM_LBUTTONDOWN 0 0
					windows.sendMessage sctrl[1] WM_LBUTTONUP 0 0
				)
			)

		)
	)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 May 2026 17:16:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/control-loft-params-from-mxs/m-p/14147342#M29439</guid>
      <dc:creator>dmitriy.shpilevoy</dc:creator>
      <dc:date>2026-05-29T17:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: Control Loft params from MXS.</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/control-loft-params-from-mxs/m-p/14147971#M29441</link>
      <description>&lt;P&gt;Okay, it's definitely not clean or stable. Nor does it work &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;BR /&gt;Command Panel behaves in a weird way - can't find it by name until I undock and dock it again. And since I can't find a way to script this redocking process, this is my code now for searching Command Panel (I have Mirror button always present in Modify panel):&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;for c in windows.getChildrenHWND #max do (
    if c[5] == "Mirror" do (
		thisParent = UIAccessor.GetParentWindow c[1]
		format "%\t|%|\n" thisParent (UIAccessor.GetWindowText thisParent)
		thisParent2 = UIAccessor.GetParentWindow thisParent
		commandPanelHwnd = UIAccessor.GetParentWindow thisParent2
	)
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;This is bad enough as it is, but on top of that both versions can't find Command Panel while it's undocked/floating.&lt;BR /&gt;Is it still a child of main max window in this state? If so, I can't find it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 May 2026 09:53:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/control-loft-params-from-mxs/m-p/14147971#M29441</guid>
      <dc:creator>dmitriy.shpilevoy</dc:creator>
      <dc:date>2026-05-30T09:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Control Loft params from MXS.</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/control-loft-params-from-mxs/m-p/14148219#M29442</link>
      <description>&lt;P&gt;Let's break down your questions:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;fn editSpinner hwnd val = 
(
	WM_CHAR 	= 0x0102
	VK_RETURN 	= 0x000D

	uiaccessor.setwindowtext hwnd (val as string)
	windows.sendMessage hwnd WM_CHAR VK_RETURN 0 -- press ENTER key
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it's how I do it.&lt;/P&gt;</description>
      <pubDate>Sat, 30 May 2026 23:44:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/control-loft-params-from-mxs/m-p/14148219#M29442</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2026-05-30T23:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Control Loft params from MXS.</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/control-loft-params-from-mxs/m-p/14148222#M29443</link>
      <description>&lt;P&gt;How is it about:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;iGlobal = (dotNetClass "Autodesk.Max.GlobalInterface").Instance
iGlobal.CoreInterface.CommandPanelRollup.Hwnd&lt;/LI-CODE&gt;&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Sun, 31 May 2026 00:39:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/control-loft-params-from-mxs/m-p/14148222#M29443</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2026-05-31T00:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Control Loft params from MXS.</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/control-loft-params-from-mxs/m-p/14148392#M29444</link>
      <description>&lt;P&gt;Hi, Denis! Am I glad to see you, man. Max was bullying me again.&lt;BR /&gt;&lt;BR /&gt;Spinner function works. Values are being set and persist.&lt;BR /&gt;I was ready to try sending RMB + click, N LMB clicks, N Alt + LMB clicks to hack it.&lt;BR /&gt;&lt;BR /&gt;And the dotnet way to get Command Panel's hwnd works also. But there is a nuance...&lt;BR /&gt;If I redock and get it as&amp;nbsp;windows.getChildHWND #max "Command Panel" and then dump children, it shows everything in every tab - 241 item. For example, even stuff from Utilities tab is getting listed.&lt;BR /&gt;It's not like I need inactive tab's controls, but listing children of dotnet-accessed panel seems to only show controls from first column - 24 items (if Command Panel was manually resized to get more info on the screen by increasing its width). By going 2 levels up from dotnet result I can get reliable, docking-state independent access and same "everything you wanted and more" amount of children.&lt;BR /&gt;&lt;BR /&gt;This is what I ended up with:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(
	fn editSpinner hwnd val = 
	(
		WM_CHAR 	= 0x0102
		VK_RETURN 	= 0x000D

		uiaccessor.setwindowtext hwnd (val as string)
		windows.sendMessage hwnd WM_CHAR VK_RETURN 0 -- press ENTER key
	)
	iGlobal = (dotNetClass "Autodesk.Max.GlobalInterface").Instance
	cmdPanel_a = iGlobal.CoreInterface.CommandPanelRollup.Hwnd
	cmdPanel_b = UIAccessor.GetParentWindow cmdPanel_a
	cmdPanel = UIAccessor.GetParentWindow cmdPanel_b
	allControls = windows.getChildrenHWND cmdPanel

	for ctrl in allControls do (
		-- format "%\n" ctrl
		-- ctrl[1] HWND, ctrl[4] class, ctrl[5] text
		if ctrl[5] == "Length Repeat:" then (
			spnrParentHwnd = UIAccessor.GetParentWindow ctrl[1]
			loftSurfParams = (windows.getChildrenHWND spnrParentHwnd)
			for lspCtrl in loftSurfParams do (
				if lspCtrl[4] == "Edit" then (
					editSpinner lspCtrl[1] "10"
				)
			)
		)
	)
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Sun, 31 May 2026 07:59:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/control-loft-params-from-mxs/m-p/14148392#M29444</guid>
      <dc:creator>dmitriy.shpilevoy</dc:creator>
      <dc:date>2026-05-31T07:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Control Loft params from MXS.</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/control-loft-params-from-mxs/m-p/14148598#M29445</link>
      <description>&lt;P&gt;You found the right solution.&lt;/P&gt;&lt;PRE&gt;CommandPanelRollup&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;is a page. You need its grand-grand parent which is … let’s call it “COMMAND TASK PANEL” &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 31 May 2026 15:43:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/control-loft-params-from-mxs/m-p/14148598#M29445</guid>
      <dc:creator>denisT.MaxDoctor</dc:creator>
      <dc:date>2026-05-31T15:43:52Z</dc:date>
    </item>
  </channel>
</rss>

