Cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Can I use MenuScript to add a PRE action to a button that is defined in a TBR file?

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Whether or not you have to be in Gateway may depend on the ENV variable

I set UGII_CAM_POST_DIR when in manufacturing.

 

Ken

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled


Re: Can I use MenuScript to add a PRE action to a button that is defined in a TBR file?

Phenom
Phenom

The two variables I'm trying to set are to control the UDF library. I've had no luck setting them at all to be honest, in Gateway or Modelling. The code runs with no errors, but nothing changes in the UDF library and listing the log file still shows the old values.

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | KF
Production: [NX8.5.3.3 MP11 64bit] Testing: [NX12.0.2 MP1]

Re: Can I use MenuScript to add a PRE action to a button that is defined in a TBR file?

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi Graham,

 

For the most part, NX reads environment variables just once, during the startup process.  Many customers set things like this in the .bat file that they use to start up NX.  I realize you might need a different one for each site, but once set, it doesn't require any special actions from the user.

 

Steve

 

Re: Can I use MenuScript to add a PRE action to a button that is defined in a TBR file?

Phenom
Phenom

The problem is not having a different library for each site, it is that we have a global library that all sites use and then each site also has their own local library. So they need to be able to switch between the libraries while inside NX. To do this manually you have to go to:

Tools->User Defined Feature->Configure Library

And then browse for the 2 files that set the library up.

To help we have a couple of macros that do this to save users having to browse for what are effectively system files. It seems the paths for these files are stored in the environment variables mentioned earlier.

 

But as my toolbox program is loading UDFs from the global library I'd like to configure NX to use the global library when it executes, otherwise it fails to find the correct UDFs.

 

However, I think I might have hit a dead end as I can not seem set these variables in my code and there is no API to do it. Also, due to complications of how we launch our toolboxes, it seems I cannot use the MenuScript solution either. I think the users will just have to remember to set the library before executing Robot Indifferent

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | KF
Production: [NX8.5.3.3 MP11 64bit] Testing: [NX12.0.2 MP1]

Re: Can I use MenuScript to add a PRE action to a button that is defined in a TBR file?

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Do the options that you need to set show up in the customer defaults? If so, which options are they?

Re: Can I use MenuScript to add a PRE action to a button that is defined in a TBR file?

Phenom
Phenom

I searched the customer defaults for UDF and although there are a load of hits none of them appear to be for the UDF library configuration.

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | KF
Production: [NX8.5.3.3 MP11 64bit] Testing: [NX12.0.2 MP1]

Re: Can I use MenuScript to add a PRE action to a button that is defined in a TBR file?

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Perhaps Gateway -> reuse library -> general -> reuse library configuration file?

That's the one that I found that sounds most like what you are after, but I'm not sure it is the one.

Re: Can I use MenuScript to add a PRE action to a button that is defined in a TBR file?

Phenom
Phenom

Yea, I saw that, but it's not what I'm after. Clicking the browse button for that lets you select a ".krx" file. Don't know what that is.

When I do

Tools->User Defined Feature->Configure Library

I have to browse for 2 files. The ones for our global library are named dbc_udf_ascii.def and udf_libraries.txt

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | KF
Production: [NX8.5.3.3 MP11 64bit] Testing: [NX12.0.2 MP1]

Re: Can I use MenuScript to add a PRE action to a button that is defined in a TBR file?

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

You should be able to specify both global and local libraries in one file, since I have done similar for testing and productive UDFs.

I think it is also possible to use a variable for the library path, so that you can set this variable through ugii_env.dat or a start up script.

 

CustomerDefaultUdfLibrary.PNG

I think the above is the easiest to set up and can have multiple libraries specified utilizing environment variables.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.2, FBM, MRL 3.1.7 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 11.4
Development: C (ITK), .NET, Tcl/Tk Testing: NX12.0 | AWC 3.4 Preparing: NX12.0

Employees of the customers, together we are strong Smiley Wink
How to Get the Most from Your Signature in the Community
NX Customization - Best Practice Guide

Re: Can I use MenuScript to add a PRE action to a button that is defined in a TBR file?

Phenom
Phenom

Interesting. I tried setting up the Global and Local libraries using the Customer Defaults and I can then see them in the ReUse library.
However, I cannot see any actual parts. Not just for my UDF libraries, but for any of the libraries.

ReuseLibrary.png

I should note that we don't use the ReUse library at all, so accessing UDFs via this route is new to me. Is there something more I need to do to be able to see my UDFs?

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | KF
Production: [NX8.5.3.3 MP11 64bit] Testing: [NX12.0.2 MP1]