Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can a custom Ribbon call a standard operation?

Status
Not open for further replies.

Kenja824

Automotive
Nov 5, 2014
949
I have custom ribbons but they only have custom DLL or Macro or VB files being executed.

I would like to make a custom ribbon that the TBR file it loads will have both custom VB files as well as a few standard operations like "Basic Curves" or "Trim Curves".


The reason is we have a specific job we do that only a few of us do here. We are often over worked and right now other departments are slowing down. THey want us to train a few others how to do this work so we will have help when we really need it. I would like to create a ribbon that anyone can open and have only the buttons we need to do this job. This way they will get used to using the same format of buttons and when we need to help them with something, we know exactly where each button we use is, and we dont need to hunt for where they keep the buttons (if they even have them available).



Ken
My brain is like a sponge. A sopping wet sponge. When I use it, I seem to lose more than I soak in.
 
Replies continue below

Recommended for you

Yes, it should be possible. Of course, you're going to have to find the correct calls for the standard functions, which can be found in the files which control the content of the out-of-the-box user interface.

John R. Baker, P.E. (ret)
Irvine, CA
Siemens PLM:

The secret of life is not finding someone to live with
It's finding someone you can't live without
 
Thanks for responding John

I tried looking at the log file right after deleting a line. I found where it was calling a dll file for it from a folder but it had a long string of characters after the dll file name.


Code:
Successfully loaded dynamic module C:\Program Files\Siemens\NX2007\NXBIN\libimplicitcore.dll

Loaded module c:\program files\siemens\nx2007\nxbin\libimplicitcore.dll 7ffcc7df0000 3f000 bfefa2a0-4d7aa78d-1cee59f-1d06de64-1=libimplicitcore___166250552264 version = 2027.3700.0.0

&MACRO MENU, 0, UG_EDIT_DELETE UG_GATEWAY_MAIN_MENUBAR < Delete> ## !

It seems to open a DLL file and from there opens a second DLL file to run? When I try executing either DLL file, it gives me an error saying "Library is missing required entry point".

So my guess is that the exact path and name of the file I want is hidden within the DLL file and there is no way for me to retrieve it?

Ken
My brain is like a sponge. A sopping wet sponge. When I use it, I seem to lose more than I soak in.
 
I had an idea. If I cannot find the original files to open in a TBR file, then what about creating a journal to initiate one of the standard buttons? Sort of a button to start a standard operation. Then I can just add that button to my TBR file.

However, if I try to record something as simple as opening Layers Visible in View, nothing records.

I have several buttons I would like to create to open standard operations but if opening them does not record, how do I do this?

Is there some sort of Journal that will start a standard operation where it would be easy to just make copies and change the name of the operation it changes?

One problem I foresee is that in modelling where we would use Layer Visible in View, we are not always in the same view, like TOP or ISO. We create a bunch of views and there is no telling which one we will be in. So the journal would need to open Visible in View to whatever view we are currently in. When doing it manually, I typically click on Layer Visible in View, then just click in the window somewhere to have it choose the current view.

Ken
My brain is like a sponge. A sopping wet sponge. When I use it, I seem to lose more than I soak in.
 
There are like two standard operations you can trigger in this way - the "new part" and "open part" dialogs. Siemens has vehemently refused to add any more so far.

You'll either have to re-implement these standard functions yourself, or use some trickery to have your buttons trigger pre-recorded macros that just press the damn buttons.
 
Thanks Bleaker

I have already started working on the latter of your suggestions. lol I tried to first record a journal to initiate an operation but it never records anything when you do so little. I hate using macros because every update half my macros stop working, but at least when I record starting an operation, it actually records it.

I have had problems in the past with macros erroring out if I select buttons. It seems that when I do them through the drop drowns in the Menu, they work better long term. Which kind of sucks trying to remember where everything is in the Menu. I get so used to using buttons. lol



Ken
My brain is like a sponge. A sopping wet sponge. When I use it, I seem to lose more than I soak in.
 
Welcome to my world lol.

Yes, Journals only record existing NXOpen API functions, and functions that just "Open Bla Dialog" are only available in the couple cases I mentioned. In every other case the Journal records what the dialog does after you press OK/Apply instead, making it useless for these custom user ribbons, where you just want a standard function dialog to be available to the user.

The "trick" with macro recording is to be as generic, and have as few recorded commands, as possible. Even then, they sometimes change internal button IDs, forcing you to re-record everything anyway.
 
Hi

Should be straight forward to put NX standard menu item, into a custom ribbon...

Simply find the "Button name" in ex. "ug_main.men", then use it in your custom *.rtb (ribbon)...

The ribbon-bar mechanism in NX interacts closely with the commands from all .*men files in a NX session.
In real life the action from a *.rtb call the "framework" of the *.men mechanism....

(see attached)

Lklo
 
 https://files.engineering.com/getfile.aspx?folder=07a4f845-962c-40f2-86cd-ea01cee375ac&file=custom_rtb_3.png
Actually this is a good solution, if all you need is a button that just opens the standard dialog. You don't need to bind any dlls to the standard commands (just make sure the buttons are compatible with your active application).

Problems begin when you want to pre-populate the standard dialog with your data.

So for your Layer visible in View thing, throw "BUTTON UG_LAYER_VIEW" into your men and rtb files, and that's pretty much it.
 
TBH, I have some experience with .tbr files and now have some understanding of .rtb files. I have never made or manipulated a .men file.

I have one .men I found in our directories that I can make some sense of. I dont quite understand the following section inside the code...

Code:
AFTER UG_TOOLBOX

  CASCADE_BUTTON UG_CUSTOM_HMS
  LABEL &HMS

END_OF_AFTER

It seems to me it is maybe telling it to place the "HMS" menu right after the UG_TOOLBOX menu, but when I go to the drop down, it is right after the "Tools" menu. Is Tools menu the same entity as the UG_TOOLBOX? How would I know what the official naming convention is for each item if they are not the same? (likely this question doesnt matter because I likely have the entire understanding of this code section wrong to begin with. lol)


Just as important, down below this area is the parts that look like a .tbr file, where they have the BUTTON, LABEL and ACTIONS. If I want to add for example, EDIT OBJECT DISPLAY to my .RTB file, how do I find the exact naming of the Edit Object Display button in NX that I would use in the RTB file so it calls the right action?

Im also a bit confused as to how this actually works to achieve my goal. To my understanding, to add a standard button to my tbr file, I would need the path and the actual button file's name. To add it to the menu, wouldnt I need the same thing? How do I find this info?

lklo - I looked at your image, but I didnt understand the point. Sorry. TBH, I couldnt figure out how you got it to appear like that even. lol

You will need to forgive me if this is a basic question that should be apparent. I do these things on the side as I am working on jobs my bosses feel are more important. I dont get to spend a couple hours reading documents to learn how they all work.



Ken
My brain is like a sponge. A sopping wet sponge. When I use it, I seem to lose more than I soak in.
 
No, you are correct. If you open the "ug_main.men" as lklo suggested, you can find the "UG_TOOLBOX" there as a button and as a menu, and it has a "LABEL &Tools" element, solving your confusion.

I don't know if there's an official naming list or anything, but you can glean that from working menu samples in NX itself.

Anyways, you can find standard button names and their labels in the %UGII_BASE_DIR%/UGII/menus/definitions_main.btn file. So for your example you just look for "Edit Object Display" in that file and find that its internal name is UG_EDIT_OBJECT_DISPLAY. So you can stick a "BUTTON UG_EDIT_OBJECT_DISPLAY" into your men and rtb files and have that button available there. You can relabel it to "Zhu Li, do the thing" with LABEL if you want, but ACTIONS is already preset for it, so you don't have to worry about that.

Right, so that "CASCADE_BUTTON" thing is you "main menu" button that is placed after Tools and opens into a new "HMS" submenu. There should be a separate "MENU UG_CUSTOM_HMS" somewhere down below, where all the buttons belonging to that menu are listed. That's where you can add these standard UI buttons as well.
 
lklo said:
Should be straight forward to put NX standard menu item, into a custom ribbon...

Simply find the "Button name" in ex. "ug_main.men", then use it in your custom *.rtb (ribbon)...

Yes, this is what I was alluding to in my initial post. It's just that it's been so long I couldn't remember the name of the files nor where to look for them [sad]

John R. Baker, P.E. (ret)
Irvine, CA
Siemens PLM:

The secret of life is not finding someone to live with
It's finding someone you can't live without
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor