Notifications
Clear all

[Closed] making a new toolbar on startup

I’m Slowly getting there


clearlistener()
dotNet.loadAssembly "system.xml"
xmlDoc=dotNetObject "system.xml.xmlDocument"
filename=("c:\	est.xml")
xmlDoc.load filename
docEle = xmlDoc.documentElement
if docEle.name == "ADSK_CUI" do(
   if docEle.ChildNodes.itemOf[0].name == "CUIWindows" do(
      newElement=xmlDoc.createElement "Window"
       newElement.setAttribute "name" "My New Toolbar"
       newElement.setAttribute "type" "T"
      newElement.setAttribute "rank" "0"
      newElement.setAttribute "subRank" "0"
      newElement.setAttribute "hidden" "0"
      newElement.setAttribute "dPanel" "1"
      newElement.setAttribute "tabbed" "0"
      newElement.setAttribute "curTab" "-1"
      newElement.setAttribute "cType" "1"
      newElement.setAttribute "toolbarRows" "1"
      newElement.setAttribute "toolbarType" "16"
      docEle.ChildNodes.itemOf[0].appendChild newElement
      
      xmlDoc.Save filename
   )
)

the test XML file is


<?xml version="1.0" encoding="utf-8"?>
<ADSK_CUI>
  <CUIWindows>
    <Window name="Command Panel" type="S" rank="0" subRank="0" hidden="0" dPanel="8" tabbed="0" curTab="-1" cType="4">
      <FRect left="1273" top="154" right="1657" bottom="1202" />
      <DRect left="1356" top="92" right="1920" bottom="1118" />
      <DRectPref left="2147483647" top="2147483647" right="-2147483648" bottom="-2147483648" />
      <CurPos left="1356" top="92" right="1920" bottom="1118" floating="0" panelID="8" />
    </Window>
  </CUIWindows>
</ADSK_CUI>

this is the end goal to add this. I have added the new <Window> entry. I just don’t know how to add a child of that yet


<Window name="My ToolBar" type="T" rank="0" subRank="0" hidden="0" dPanel="1" tabbed="0" curTab="-1" cType="1" toolbarRows="1" toolbarType="16">
            <FRect left="913" top="103" right="1209" bottom="164" />
            <DRect left="1427" top="53" right="1728" bottom="92" />
            <DRectPref left="2147483647" top="2147483647" right="-2147483648" bottom="-2147483648" />
            <CurPos left="913" top="103" right="1217" bottom="172" floating="1" panelID="16" />
            <Items>
                <Item typeID="2" type="CTB_MACROBUTTON" width="0" height="0" controlID="0" macroTypeID="3" macroType="MB_TYPE_ACTION" actionTableID="647394" imageID="-1" imageName="" actionID="Nite`Software" tip="main" label="Nite" /&gt;
                &lt;Item typeID="2" type="CTB_MACROBUTTON" width="0" height="0" controlID="0" macroTypeID="3" macroType="MB_TYPE_ACTION" actionTableID="647394" imageID="-1" imageName="" actionID="rensic`Software" tip="Scene Checker" label="rensic" />
            </Items>
</Window>

Your sample is just not out there. It has been removed from the world.

do you know how to add a child in my new <Window> entry?

Got it! Its done

Page 2 / 2