Itoo Software Forum

Author Topic: Set default layer name "railclone_instances" via MaxScript  (Read 2471 times)

Klonsemann

  • Jr. Member
  • **
  • Posts: 61
Set default layer name "railclone_instances" via MaxScript
« on: July 08, 2015, 11:38:03 AM »
From what location does RailClone get its default layer name ?
Im working in a sutio and we want to setup all workstations automatic the same.

I cannot find it in the ini files, nore in the registry.

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 4388
    • iToo Software
Re: Set default layer name "railclone_instances" via MaxScript
« Reply #1 on: July 08, 2015, 07:41:13 PM »
The default layer name is hardcoded. I'm afraid it's not possible to change it.

I'm searching if there is some way to modify the parameters of Utility plugins from Maxscript, but unfortunately i cannot find anything either. It seems this part of Max if not exposed to Maxscript.
Carlos Quintero
iToo Software

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2991
Re: Set default layer name "railclone_instances" via MaxScript
« Reply #2 on: July 09, 2015, 09:45:27 AM »
EDIT: Use the script later in the thread if you use a floating command panel

Hi!

I've attached a script that might be useful to set the RailClone and Forest Pack tool's default Layer names at startup. Unfortunately as Carlos already mentioned , Utilities are not exposed to maxscript. There is a workaround that involves using UIAccessor to simulate interaction with the max interface. It's not the most elegant solution but it seems to work.

Just put the script in the scripts/startup folder in the Max root directory and change the values of railCloneLayerName and forestLayerName to the new layer names you wish to use.

I hope that helps. Many thanks,

Paul.

p.s. Thanks to DenisT  for his posts on on CG Talk about using UIAccessor.
« Last Edit: July 09, 2015, 05:20:32 PM by Paul Roberts »
Paul Roberts
iToo Software

Klonsemann

  • Jr. Member
  • **
  • Posts: 61
Re: Set default layer name "railclone_instances" via MaxScript
« Reply #3 on: July 09, 2015, 03:36:31 PM »
Hi Paul,

im currently working with Max2014 and your posted Script seems not to work here.

UtilityPanel.OpenUtility RailClone_Tools switches the commandpanet to utilitys and opens the RailClone Utility correct, but
windows.getchildhwnd #max "RailClone Tools" does not find the interface.

If im listing all child windows with print (windows.getChildrenHWND #max) no RailClone or ForestPack gets listed.

Code: [Select]
print (windows.getChildrenHWND #max)
#(1187674P, 3935080P, 3935080P, "#32770", "Ribbon", 3935080P, 3935080P, 3935080P)
#(2368188P, 3935080P, 3935080P, "#32770", "KANI Toolbar", 3935080P, 3935080P, 3935080P)
#(16322104P, 2368188P, 2368188P, "CustToolbar", "", 0P, 3935080P, 3935080P)
#(4260978P, 16322104P, 16322104P, "CustButton", "", 0P, 3935080P, 3935080P)
#(8327286P, 16322104P, 16322104P, "CustButton", "", 0P, 3935080P, 3935080P)
#(8591142P, 16322104P, 16322104P, "CustButton", "", 0P, 3935080P, 3935080P)
#(3740320P, 16322104P, 16322104P, "CustButton", "", 0P, 3935080P, 3935080P)
#(15863134P, 16322104P, 16322104P, "CustButton", "", 0P, 3935080P, 3935080P)
#(14882366P, 16322104P, 16322104P, "CustButton", "", 0P, 3935080P, 3935080P)
#(19269890P, 16322104P, 16322104P, "CustButton", "", 0P, 3935080P, 3935080P)
#(2564072P, 3935080P, 3935080P, "#32770", "Main Toolbar", 3935080P, 3935080P, 3935080P)
#(2499398P, 2564072P, 2564072P, "CustToolbar", "", 0P, 3935080P, 3935080P)
#(42865976P, 2499398P, 2499398P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(3874564P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(2630886P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(12586366P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(16060120P, 2499398P, 2499398P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(20847256P, 2499398P, 2499398P, "ComboBox", "All", 0P, 3935080P, 3935080P)
#(2761484P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(6888768P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(4002394P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(533220P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(6492810P, 2499398P, 2499398P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(727584P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(1123458P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(2495590P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(4924724P, 2499398P, 2499398P, "ComboBox", "View", 0P, 3935080P, 3935080P)
#(3676298P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(5511234P, 2499398P, 2499398P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(3805988P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(2626162P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(34804858P, 2499398P, 2499398P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(3215884P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(2499640P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(13309236P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(12130170P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(24516526P, 2499398P, 2499398P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(11604858P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(2499366P, 2499398P, 2499398P, "ComboBox", "Create Selection Set", 0P, 3935080P, 3935080P)
#(12783336P, 2499366P, 2499366P, "Edit", "Create Selection Set", 0P, 3935080P, 3935080P)
#(2564666P, 2499398P, 2499398P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(2106006P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(9903132P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(2761454P, 2499398P, 2499398P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(2170614P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(2433674P, 2499398P, 2499398P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(3279392P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(2499342P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(4529436P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(2302628P, 2499398P, 2499398P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(2302636P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(37492168P, 2499398P, 2499398P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(2368092P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(2564874P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(9245884P, 2499398P, 2499398P, "CustButton", "", 0P, 3935080P, 3935080P)
#(533592P, 3935080P, 3935080P, "AutoHideStrip", "AutoHideStrip", 0P, 3935080P, 3935080P)
#(3086520P, 3935080P, 3935080P, "AutoHideStrip", "AutoHideStrip", 0P, 3935080P, 3935080P)
#(468120P, 3935080P, 3935080P, "AutoHideStrip", "AutoHideStrip", 0P, 3935080P, 3935080P)
#(533716P, 3935080P, 3935080P, "AutoHideStrip", "AutoHideStrip", 0P, 3935080P, 3935080P)
#(17237926P, 3935080P, 3935080P, "StatusPanel", "", 0P, 3935080P, 3935080P)
#(7341982P, 17237926P, 17237926P, "SepWindow", "", 0P, 3935080P, 3935080P)
#(2301752P, 17237926P, 17237926P, "CustToolbar", "", 0P, 3935080P, 3935080P)
#(5834776P, 2301752P, 2301752P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(22087568P, 2301752P, 2301752P, "CustStatus", "None Selected", 0P, 3935080P, 3935080P)
#(57349596P, 2301752P, 2301752P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(11146662P, 2301752P, 2301752P, "CustButton", "", 0P, 3935080P, 3935080P)
#(9443006P, 2301752P, 2301752P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(4720810P, 2301752P, 2301752P, "CustButton", "", 0P, 3935080P, 3935080P)
#(17500216P, 2301752P, 2301752P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(2499318P, 2301752P, 2301752P, "CustButton", "", 0P, 3935080P, 3935080P)
#(8592762P, 2301752P, 2301752P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(3344410P, 2301752P, 2301752P, "Static", "X:", 0P, 3935080P, 3935080P)
#(2823652P, 2301752P, 2301752P, "CustEdit", "", 0P, 3935080P, 3935080P)
#(10229224P, 2823652P, 2823652P, "EDITDUMMY", "", 0P, 3935080P, 3935080P)
#(1247290P, 10229224P, 10229224P, "Edit", "", 0P, 3935080P, 3935080P)
#(6624868P, 2301752P, 2301752P, "SpinnerControl", "", 0P, 3935080P, 3935080P)
#(6229396P, 2301752P, 2301752P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(5252280P, 2301752P, 2301752P, "Static", "Y:", 0P, 3935080P, 3935080P)
#(16061188P, 2301752P, 2301752P, "CustEdit", "", 0P, 3935080P, 3935080P)
#(8916312P, 16061188P, 16061188P, "EDITDUMMY", "", 0P, 3935080P, 3935080P)
#(7673404P, 8916312P, 8916312P, "Edit", "", 0P, 3935080P, 3935080P)
#(4786664P, 2301752P, 2301752P, "SpinnerControl", "", 0P, 3935080P, 3935080P)
#(592380P, 2301752P, 2301752P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(8325726P, 2301752P, 2301752P, "Static", "Z:", 0P, 3935080P, 3935080P)
#(13241004P, 2301752P, 2301752P, "CustEdit", "", 0P, 3935080P, 3935080P)
#(22484626P, 13241004P, 13241004P, "EDITDUMMY", "", 0P, 3935080P, 3935080P)
#(10160900P, 22484626P, 22484626P, "Edit", "", 0P, 3935080P, 3935080P)
#(6359874P, 2301752P, 2301752P, "SpinnerControl", "", 0P, 3935080P, 3935080P)
#(5180244P, 2301752P, 2301752P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(533594P, 2301752P, 2301752P, "CustStatus", "Grid = 10,0cm", 0P, 3935080P, 3935080P)
#(2689934P, 17237926P, 17237926P, "CustToolbar", "StatusPanelBottomContainer", 0P, 3935080P, 3935080P)
#(12915904P, 2689934P, 2689934P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(3085220P, 2689934P, 2689934P, "CustStatus", "Click or click-and-drag to select objects", 0P, 3935080P, 3935080P)
#(2303040P, 2689934P, 2689934P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(6558526P, 2689934P, 2689934P, "CustButton", "", 0P, 3935080P, 3935080P)
#(17695892P, 2689934P, 2689934P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(34607746P, 2689934P, 2689934P, "CustStatus", "Add Time Tag", 0P, 3935080P, 3935080P)
#(5768480P, 2689934P, 2689934P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(9833318P, 2689934P, 2689934P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(4856872P, 17237926P, 17237926P, "msctls_progress32", "", 0P, 3935080P, 3935080P)
#(3084348P, 17237926P, 17237926P, "#32770", "", 0P, 3935080P, 3935080P)
#(41226306P, 3084348P, 3084348P, "MXS_Scintilla", "print (windows.getChildrenHWND #max)", 0P, 3935080P, 3935080P)
#(17698892P, 3084348P, 3084348P, "MXS_Scintilla", "", 0P, 3935080P, 3935080P)
#(14355858P, 3935080P, 3935080P, "EatInput", "", 0P, 3935080P, 3935080P)
#(4200330P, 14355858P, 14355858P, "Button", "Cancel", 0P, 3935080P, 3935080P)
#(3089656P, 3935080P, 3935080P, "ViewPanel", "", 0P, 3935080P, 3935080P)
#(2237140P, 3089656P, 3089656P, "Label", "", 0P, 3935080P, 3935080P)
#(2237088P, 3089656P, 3089656P, "Label", "", 0P, 3935080P, 3935080P)
#(4857064P, 3089656P, 3089656P, "Label", "", 0P, 3935080P, 3935080P)
#(3939582P, 3089656P, 3089656P, "Label", "", 0P, 3935080P, 3935080P)
#(2695998P, 3089656P, 3089656P, "D3DWindow", "Top", 0P, 3935080P, 3935080P)
#(3021170P, 3089656P, 3089656P, "D3DWindow", "Front", 0P, 3935080P, 3935080P)
#(15602780P, 3089656P, 3089656P, "D3DWindow", "Left", 0P, 3935080P, 3935080P)
#(6821802P, 3089656P, 3089656P, "D3DWindow", "Perspective", 0P, 3935080P, 3935080P)
#(2368214P, 3089656P, 3089656P, "VptSplitterBar", "", 0P, 3935080P, 3935080P)
#(4328964P, 3089656P, 3089656P, "VptSplitterBar", "", 0P, 3935080P, 3935080P)
#(2302582P, 3935080P, 3935080P, "TimePanel", "", 0P, 3935080P, 3935080P)
#(13637540P, 2302582P, 2302582P, "CustToolbar", "", 0P, 3935080P, 3935080P)
#(2368330P, 13637540P, 13637540P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(7083730P, 13637540P, 13637540P, "CustButton", "", 0P, 3935080P, 3935080P)
#(2302622P, 13637540P, 13637540P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(2039604P, 13637540P, 13637540P, "CustButton", "", 0P, 3935080P, 3935080P)
#(2430014P, 13637540P, 13637540P, "CustButton", "", 0P, 3935080P, 3935080P)
#(402042P, 13637540P, 13637540P, "CustButton", "", 0P, 3935080P, 3935080P)
#(14620114P, 13637540P, 13637540P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(27463460P, 13637540P, 13637540P, "CustButton", "", 0P, 3935080P, 3935080P)
#(2368206P, 2302582P, 2302582P, "CustToolbar", "", 0P, 3935080P, 3935080P)
#(2368182P, 2368206P, 2368206P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(2234936P, 2368206P, 2368206P, "CustButton", "", 0P, 3935080P, 3935080P)
#(24776186P, 2368206P, 2368206P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(6950728P, 2368206P, 2368206P, "CustEdit", "", 0P, 3935080P, 3935080P)
#(4921350P, 6950728P, 6950728P, "EDITDUMMY", "", 0P, 3935080P, 3935080P)
#(4464002P, 4921350P, 4921350P, "Edit", "0", 0P, 3935080P, 3935080P)
#(3673776P, 2368206P, 2368206P, "SpinnerControl", "", 0P, 3935080P, 3935080P)
#(27396450P, 2368206P, 2368206P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(1509702P, 2368206P, 2368206P, "CustButton", "", 0P, 3935080P, 3935080P)
#(2690696P, 3935080P, 3935080P, "AnimatePanel", "", 0P, 3935080P, 3935080P)
#(32640532P, 2690696P, 2690696P, "Button", "", 0P, 3935080P, 3935080P)
#(6688316P, 2690696P, 2690696P, "Button", "", 0P, 3935080P, 3935080P)
#(7147086P, 2690696P, 2690696P, "Button", "", 0P, 3935080P, 3935080P)
#(12062324P, 2690696P, 2690696P, "Button", "", 0P, 3935080P, 3935080P)
#(3020076P, 2690696P, 2690696P, "CustToolbar", "", 0P, 3935080P, 3935080P)
#(2626576P, 3020076P, 3020076P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(2690714P, 3020076P, 3020076P, "ComboBox", "Selected", 0P, 3935080P, 3935080P)
#(1116518P, 2690696P, 2690696P, "CustToolbar", "", 0P, 3935080P, 3935080P)
#(2165776P, 1116518P, 1116518P, "CustButton", "", 0P, 3935080P, 3935080P)
#(10292920P, 3935080P, 3935080P, "TimeSlider", "TimeSlider", 0P, 3935080P, 3935080P)
#(3673810P, 10292920P, 10292920P, "TimeSliderThumb", "TimeSliderThumb", 0P, 3935080P, 3935080P)
#(45682400P, 10292920P, 10292920P, "Button", "<", 0P, 3935080P, 3935080P)
#(3153254P, 10292920P, 10292920P, "Button", ">", 0P, 3935080P, 3935080P)
#(20190804P, 3935080P, 3935080P, "MIDIDummyWindow", "", 0P, 3935080P, 3935080P)
#(3936630P, 3935080P, 3935080P, "ViewControlPanel", "", 0P, 3935080P, 3935080P)
#(5968664P, 3936630P, 3936630P, "CustToolbar", "", 0P, 3935080P, 3935080P)
#(4463888P, 5968664P, 5968664P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(8524880P, 5968664P, 5968664P, "CustButton", "", 0P, 3935080P, 3935080P)
#(5114222P, 5968664P, 5968664P, "CustButton", "", 0P, 3935080P, 3935080P)
#(4133586P, 5968664P, 5968664P, "CustButton", "", 0P, 3935080P, 3935080P)
#(2626214P, 5968664P, 5968664P, "CustButton", "", 0P, 3935080P, 3935080P)
#(3018560P, 3936630P, 3936630P, "CustToolbar", "", 0P, 3935080P, 3935080P)
#(2102416P, 3018560P, 3018560P, "CustSeparator", "", 0P, 3935080P, 3935080P)
#(2887606P, 3018560P, 3018560P, "CustButton", "", 0P, 3935080P, 3935080P)
#(1773532P, 3018560P, 3018560P, "CustButton", "", 0P, 3935080P, 3935080P)
#(1970144P, 3018560P, 3018560P, "CustButton", "", 0P, 3935080P, 3935080P)
#(3084292P, 3018560P, 3018560P, "CustButton", "", 0P, 3935080P, 3935080P)
#(5181450P, 3935080P, 3935080P, "TrackBar", "", 0P, 3935080P, 3935080P)
#(2428952P, 5181450P, 5181450P, "CustToolbar", "", 0P, 3935080P, 3935080P)
#(12064516P, 2428952P, 2428952P, "CustButton", "", 0P, 3935080P, 3935080P)
#(9965736P, 3935080P, 3935080P, "Button", "Cancel Expert Mode", 0P, 3935080P, 3935080P)
#(16977692P, 3935080P, 3935080P, "AutoHideStrip", "AutoHideStrip", 0P, 3935080P, 3935080P)
#(26350320P, 3935080P, 3935080P, "AutoHideStrip", "AutoHideStrip", 0P, 3935080P, 3935080P)
#(13308542P, 3935080P, 3935080P, "AutoHideStrip", "AutoHideStrip", 0P, 3935080P, 3935080P)
#(2368198P, 3935080P, 3935080P, "AutoHideStrip", "AutoHideStrip", 0P, 3935080P, 3935080P)
#(7607028P, 3935080P, 3935080P, "AdImpApplicationFrame", "AdImpApplicationFrame", 0P, 3935080P, 3935080P)
#(22219862P, 7607028P, 7607028P, "HwndWrapper[3dsmax.exe;;5afd9e10-bd1a-49a4-b9b9-07f81543fc85]", "QATHwndSource", 0P, 3935080P, 3935080P)
#(1253044P, 7607028P, 7607028P, "HwndWrapper[3dsmax.exe;;c958c919-dff7-4f70-af22-9743a3b0565f]", "InfoCenterHwndSource", 0P, 3935080P, 3935080P)
#(4132872P, 3935080P, 3935080P, "ATSMsgWindow", "", 0P, 3935080P, 3935080P)
OK

The MaxHelp says that the Windows methods were introduced in max2008, so that for it should work.

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2991
Re: Set default layer name "railclone_instances" via MaxScript
« Reply #4 on: July 09, 2015, 04:04:00 PM »
Hi,

That's odd. I have it running fine here but in Max 2016. I'll try it on an older version and see what happens.

Thanks,

Paul
Paul Roberts
iToo Software

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2991
Re: Set default layer name "railclone_instances" via MaxScript
« Reply #5 on: July 09, 2015, 04:14:48 PM »
It works fine for me in 2013 too, and RailClone tools is listed using print (windows.getChildrenHWND #max)

Running these two lines works for me as shown below.  But RailClone Tools must be loaded and visible for windows.getchildhwnd #max "RailClone Tools" to work correctly

Code: [Select]
UtilityPanel.OpenUtility RailClone_Tools
true
windows.getchildhwnd #max "RailClone Tools"
#(528450P, 528452P, 528452P, "RollupPanelTitle", "RailClone Tools", 0P, 200010P, 200010P)

Paul Roberts
iToo Software

Klonsemann

  • Jr. Member
  • **
  • Posts: 61
Re: Set default layer name "railclone_instances" via MaxScript
« Reply #6 on: July 09, 2015, 04:33:46 PM »
At first. Big Thanks for fast as hell feedback.

I tried this, but as in the first time it does not work.

As i take a screenshot for uploading i docked my commandpanel for having only one screen to caputre.
I give it another try. And guess what, it works.

So the problem was that my commandpanel ist NOT docked in the Max UI.
Its a seperate floater on the second screen.
All our workstations have this setup.

EDIT

Code: [Select]
windows.getchildhwnd 0 "Command Panel"
#(11995766P, 65552P, 3935080P, "#32770", "Command Panel", 3935080P, 11995766P, 3935080P)
« Last Edit: July 09, 2015, 04:39:51 PM by Klonsemann »

Klonsemann

  • Jr. Member
  • **
  • Posts: 61
Re: Set default layer name "railclone_instances" via MaxScript
« Reply #7 on: July 09, 2015, 04:47:32 PM »
Code: [Select]
--------------------------------------------------------------------------------------------
--Sets the Default Layer Names for the RailClone and Forest Pack Tool Utilities--
--------------------------------------------------------------------------------------------

fn changeItooLayers =
(
local railCloneLayerName = "RC_Layer_name"
local forestLayerName = "FP_Layer_name"
local WM_CHAR = 0x0102
local VK_RETURN = 0x000D

if RailClone_Tools != undefined then
(
UtilityPanel.OpenUtility RailClone_Tools
--iTooRailcloneUtility= windows.getChildHWND (windows.getchildhwnd #max "RailClone Tools")[2] "railclone_instances"
iTooRailcloneUtility = windows.getChildHWND (windows.getChildHWND ( windows.getchildhwnd 0 "Command Panel" )[2] "RailClone Tools")[2] "railclone_instances"
uiaccessor.setwindowtext  iTooRailcloneUtility[1] railCloneLayerName
windows.sendMessage iTooRailcloneUtility[1] WM_CHAR VK_RETURN 0
)

if Forest_Tools != undefined then
(
UtilityPanel.OpenUtility Forest_Tools
--iTooForestUtility= windows.getChildHWND (windows.getchildhwnd #max "Forest Tools")[2] "forest_instances"
iTooForestUtility = windows.getChildHWND (windows.getChildHWND ( windows.getchildhwnd 0 "Command Panel" )[2] "Forest Tools")[2] "forest_instances"
uiaccessor.setwindowtext  iTooForestUtility[1] forestLayerName
windows.sendMessage iTooForestUtility[1] WM_CHAR VK_RETURN 0
)
setCommandPanelTaskMode #create
)

changeItooLayers()

That should do the job.

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2991
Re: Set default layer name "railclone_instances" via MaxScript
« Reply #8 on: July 09, 2015, 05:06:38 PM »
EDIT: Corrected a misnamed variable

You beat me to it :)

Glad we sorted that out. Same solution, but I've added a version with a simple try catch so that it'll work if the panel is docked or floating.

Cheers!

Paul
« Last Edit: July 09, 2015, 05:15:22 PM by Paul Roberts »
Paul Roberts
iToo Software