Community
PowerMill Forum
Welcome to Autodesk’s PowerMill Forums. Share your knowledge, ask questions, and explore popular PowerMill topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Ribbon DropDown menu trick

40 REPLIES 40
SOLVED
Reply
Message 1 of 41
dsmits
6118 Views, 40 Replies

Ribbon DropDown menu trick

 

 

some Kudos would be great 🙂

 

after button 1 & 2 you can pretty much just copy and paste your ribbon button/macro/cmd right in order like you normally would edit your ribbon (notepad++). for button 1 and 2 you need to keep this format to a point.

Note---you cannot edit your tree in power mill, you will have to do your changes in notepad and import your ribbon in. But after you import it in you can move your dropdown to another ribbon.

so i would finish your drop down and then move to your desire ribbon

 

Note-- you can make drop downs from other dropdown items but does get pretty confusing. ill post that one too if i still have.

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<entry application="PowerMill" application_version="1" type="uiRIBBONBAR" version="1">

  <entry type="uiCATEGORY">
    <resource key="uiLABELSTRING" value="TREE"/>
    <entry type="uiPANEL">
      <resource key="uiLABELSTRING" value="GROUP NAME"/>
      <resource key="uiRIBPANELALIGNMENT" value="false"/>
      <entry base_widget="Ribbon.Home.Macro.MacroRun" recursive="false">
        <resource key="uiLABELSTRING" value="THIS IS NUMBER 1"/>
        <resource key="uiBITMAP" value="CETEXTAROUNDCIRCLE"/>
        <resource key="uiCOMMAND" value="print = 1"/>
        <resource key="uiDYNAMICHELP" value="Text"/>
        <entry type="uiICONBUTTON">
         <resource key="uiLABELSTRING" value="This is number 2"/>
          <resource key="uiBITMAP" value="ROUTING"/>
          <resource key="uiCOMMAND" value="print = 2"/>
          <resource key="uiEDITTYPE" value="CommandButton"/>
        </entry>
      </entry>
      <entry type="uiICONBUTTON">
       <entry type="uiICONBUTTON">
          <resource key="uiLABELSTRING" value="This is Number 3"/>
          <resource key="uiBITMAP" value="ROUTING"/>
          <resource key="uiCOMMAND" value="print = 3"/>
          <resource key="uiEDITTYPE" value="CommandButton"/>
        </entry>
        <entry type="uiICONBUTTON">
          <resource key="uiLABELSTRING" value="This is Number 4"/>
          <resource key="uiBITMAP" value="ROUTING"/>
          <resource key="uiCOMMAND" value="print = 4"/>
          <resource key="uiEDITTYPE" value="CommandButton"/>
        </entry>
        <entry type="uiICONBUTTON">
          <resource key="uiLABELSTRING" value="This is Number 5"/>
          <resource key="uiBITMAP" value="ROUTING"/>
          <resource key="uiCOMMAND" value="print = 5"/>
          <resource key="uiEDITTYPE" value="CommandButton"/>
        </entry>
        <entry type="uiICONBUTTON">
          <resource key="uiLABELSTRING" value="This is Number 6"/>
          <resource key="uiBITMAP" value="ROUTING"/>
          <resource key="uiCOMMAND" value="print = 6"/>
          <resource key="uiEDITTYPE" value="CommandButton"/>
        </entry>
      </entry>
    </entry>
  </entry>
</entry>

ribbontree.pngplease like for sharing 

40 REPLIES 40
Message 2 of 41
dsmits
in reply to: dsmits

here is the little button

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<entry application="PowerMill" application_version="1" type="uiRIBBONBAR" version="1">

 <entry type="uiCATEGORY">
    <resource key="uiLABELSTRING" value="New Tab"/>

    <entry type="uiPANEL">
      <resource key="uiLABELSTRING" value="littleicon"/>
      <resource key="uiCOMMAND" value="print = 2"/>
      <resource key="uiRIBPANELALIGNMENT" value="false"/>
      <resource key="uiEDITTYPE" value="CommandButton"/>
      <entry type="uiICONBUTTON"/>
    </entry>
  </entry>
Message 3 of 41
danmic7JH66
in reply to: dsmits

This legitimately has me excited. I'd kudos this twice if  I could.

Message 4 of 41
GlennM.MCAM
in reply to: dsmits

Thanks for sharing!

 

Do you need to assign a macro to the specified buttons with the customize ribbon menu or do you edit the uiCOMMAND line with "macro C:/macros/macro1.mac" ?

 

Glenn


Intel i7 4790 @ 3.60GHz -16GB RAM - Nvidia Quadro K620 - 250GB SSD - Win 7 Pro x64 SP1
PowerMILL Premium 2019.1 - PowerINSPECT Ultimate OMV 2017 SP6
Message 5 of 41

This is very clever!

 

You can do all sorts of things through editing the file by hand, it corresponds more or less directly to how our user interface is defined internally. What's exposed on the GUI only scratches the surface.

 

However, because it is so powerful, it's quite easy to shoot yourself in the foot with it! It's quite easy to get the file into a bad state, and this could potentially prevent you from being able to start PowerMill. Hence, when I saw a recent post go by on the subject of custom menus, I thought twice about offering a solution like this.

 

But since the cat is out of the bag, I will offer a few words of advice.

  1. If you are going to be hand-editing the file, always make a backup!
  2. Even if it appears to work, if you have arrived at a working file by trial and error, there's a chance you might have done something that will cause it to behave in an unexpected manner, or to go wrong in future.
  3. If you have hand-edited the file, there's a greater chance of it getting broken by an update.

So long as you take backups when doing this sort of thing, it should be OK 🙂

 

Here's an annotated customisation file containing a slightly more refined way of defining a custom menu:

 

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

<!-- DO NOT CHANGE THIS.  This is the 'root' of the tree, it represents the ribbon.  The
file is a tree structure of 'entries' each of which represents a 'widget' you see on the
user interface. -->
<entry application="PowerMill" application_version="1" type="uiRIBBONBAR" version="1">

  <!-- This is a special entry that represents the quick access toolbar. -->
  <entry type="uiQUICKACCESSTOOLBAR">
  
    <!-- This sort of entry refers to an existing widget elsewhere on the ribbon.  If
    the widget being referred to does not exist, it will be ignored.
    
    IT'S PROBABLY BEST TO AVOID HAND-EDITING BASE_WIDGET ENTRIES
    -->
    <entry base_widget="Ribbon.BackstageView.OPEN" recursive="true"/>
    <entry base_widget="Ribbon.BackstageView.SAVE_PROJECT" recursive="true"/>
  </entry>

  <!-- This is a ribbon tab.  Entries like this, that say 'type' and not 'base_widget',
  define completely new widgets and don't refer to anything that already exists.  It's 
  much safer to fiddle about with these than with the other ones. -->
  <entry type="uiCATEGORY">
  
    <!-- You can set 'resources' on entries in this way.  These are properties like the
    label used for them. -->
    <resource key="uiLABELSTRING" value="My Tab"/>
    
    <!-- This is a panel or 'group' on a tab. -->
    <entry type="uiPANEL">
      <resource key="uiLABELSTRING" value="My Panel"/>
      
      <!-- --------------------------------------------------------------- -->
      <!-- This is how to add a custom menu.  You can copy this 
      into a panel in your own file.  Note that the menu is of
      type 'uiRIBMENUBUTTON' and the buttons are 'uiPUSHBUTTON'. 

      -->
      <entry type="uiRIBMENUBUTTON">
        <resource key="uiLABELSTRING" value="My Menu"/>
        
        <!-- This is a command button.  The uiEDITTYPE is a hint to
        the GUI that determines how the button is edited. -->
        <entry type="uiPUSHBUTTON">
          <resource key="uiLABELSTRING" value="My Button 1"/>
          <resource key="uiBITMAP" value="A360"/>
          <resource key="uiCOMMAND" value="PRINT PAR 'HELLO'"/>
          <resource key="uiEDITTYPE" value="CommandButton"/>
        </entry>

        <!-- This is a macro button.  The path to the macro goes
        in the uiUSERDATA field, and the command is set to 'MACRO %u'.
        -->
        <entry type="uiPUSHBUTTON">
          <resource key="uiLABELSTRING" value="My Button 2"/>
          <resource key="uiBITMAP" value="ACTPATTERN"/>
          <resource key="uiUSERDATA" value="C:\MyMacro.mac"/>
          <resource key="uiCOMMAND" value="MACRO %u"/>
          <resource key="uiEDITTYPE" value="MacroButton"/>
        </entry>
      </entry>
      <!-- End of custom menu -->
      <!-- --------------------------------------------------------------- -->
      
    </entry>
  </entry>
</entry>

This is quite a popular request on here, so it would be nice to add GUI for it eventually. But until then, I hope you find the above example helpful.


Nathan Woodward
Senior Software Engineer
Message 6 of 41
design
in reply to: dsmits

Wow  impressive, i was searching this solution for a long time ago, and now i´m playing whith my powermil buttons like a little boy 🙂

Vilchez
Message 7 of 41
Beta_Librae
in reply to: dsmits

Thanks for sharing that with all of us on here. 

Now that Nathans got me scared that I'm gonna screw my system if I do this wrong, what do I do with the XML file? Where do I put it?


Kind Regards,
Not cnc, you can call me Peabrain
Message 8 of 41

You won't screw up your whole system, just potentially the customisation file - which you can always delete to get back into a working state. So long as you make a backup of your configuration before going 'off road' you should be fine. You can do this either by taking a copy of the file, or by exporting it from the 'customise ribbon' form.

 

The customisation file is in your PowerMill AppData directory, this is usually C:\Users\<you>\AppData\Local\Autodesk\PowerMill\ribbon_customisation.xml

 

I've attached a file 'option_menu.xml'. You should be able to just import it via the 'customise ribbon' form. You can edit the XML to add your own buttons before importing it.


Nathan Woodward
Senior Software Engineer
Message 9 of 41

Thanks for the support Nathan,

I'm glad you chimed in on this one. It's guys like you and all the other great users on here that make the forum such an amazing tool.


Kind Regards,
Not cnc, you can call me Peabrain
Message 10 of 41
rui_rita
in reply to: Beta_Librae

Hi,

 

How can I get this type?2018-06-06_1807.png



Os melhores cumprimentos | Best regards
Rui Rita
________________________________
NEWCAM, Lda.
Message 11 of 41
dsmits
in reply to: rui_rita

now your pushing it lol.

its what i was really after but i havnt figured that one out yet.

these are the only ones i have working

ribbonpic.png

any thoughts NathanWoodward ?

Message 12 of 41
NathanWoodward
in reply to: dsmits

If I understand correctly, you're asking whether you can have an entity selection drop down in your customisation?

 

If so, I'm afraid that's not possible.


Nathan Woodward
Senior Software Engineer
Message 13 of 41

Good Morning Nathan, Everybody,

 

Is it possible to source the proper names for the icons that aren't available in the ribbon customization window. 

I've found the toolpath icons and the bitmap_mapping file inside the Powermill 2019 folder but can't find what I'm looking for. 


Kind Regards,
Not cnc, you can call me Peabrain
Message 14 of 41
design
in reply to: Beta_Librae

save the bitmap file in *.png and put the direcction here

 

 <entry base_widget="Ribbon.Home.Macro.MacroRun" recursive="false">
        <resource key="uiLABELSTRING" value="THIS IS NUMBER 1"/>
        <resource key="uiBITMAP" value="c:\bla\bla.png"/>
        <resource key="uiCOMMAND" value="print = 1"/>
        <resource key="uiDYNAMICHELP" value="Text"/>

Vilchez
Message 15 of 41
Beta_Librae
in reply to: design

Sweet, it worked as a *.ico from the file location as well.

 

<entry base_widget="Ribbon.Home.Macro.MacroRun" recursive="false">

Do you know what the line above represents?


Kind Regards,
Not cnc, you can call me Peabrain
Message 16 of 41

Hi,

 

In one of my earlier replies there is an annotated XML file where I go into this a bit.

 

That's how we represent a copy of an existing button - that one is the 'run macro' option button from the home tab.

 

If you're trying to define your own custom option menu, it's probably best if you instead go with the method I suggest in my previous replies, which is likely to be more reliable - see my attached XML file earlier for what to do.

 

Hope that's helpful

Nathan


Nathan Woodward
Senior Software Engineer
Message 17 of 41

Thanks Nathan,

 

I'm having quite a bit of success creating custom menus using the .xml  file. I'm really trying to get a better handle on what some of the command lines mean.

 

<resource key="uiRIBPANELALIGNMENT" value="false"/>

<entry type="uiRIBMENUBUTTON">

 


Kind Regards,
Not cnc, you can call me Peabrain
Message 18 of 41

The first one governs how a panel is laid out. I can't remember precisely what the effect of it is, but you can experiment with it if you like!

 

The second one means 'start the definition of a menu'.

 

Bear in mind that this is really all 'internal workings', there will be things in here that won't make much sense, it's quite easy to get things wrong, and things could change in future.


Nathan Woodward
Senior Software Engineer
Message 19 of 41
Beta_Librae
in reply to: dsmits

Good Morning and Happy New Year @dsmits,

Curious how you made the slide bar shown in this thread. I think it could be a pretty cool addition to the software. What are you using it for? Could it be used for minimum tool radius?


Kind Regards,
Not cnc, you can call me Peabrain
Message 20 of 41
dsmits
in reply to: Beta_Librae

prolly could but html or plugin would be a better option

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report