Cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing .afuManager screen selection

Phenom
Phenom

To all

 

I am looking at the .AfuManager class and I am wondering if there is a way of accessing the user selection on the screen. I can export the data of an afu record (automatically for a a given record) to a csv file. What I am looking/investigating at the moment is a way of getting the user selection on the screen ie which afu record has been selected/highlited in the afu manager

 

Thanks

 

Regards

 

JXB

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)
8 REPLIES

Re: Accessing .afuManager screen selection

Siemens Phenom Siemens Phenom
Siemens Phenom

No. NX Open does not interact with the NX UI in this manner. You can use the Block Styler to build your own dialog populated with the list of AFU records to allow the user to make a selection.

Re: Accessing .afuManager screen selection

Phenom
Phenom

Thanks JimB. At least I didn't waste too much time Does one need a "full" UI styler approach or is there another way around? I have seen function displaying all the groups available for selection. I am using one of them to process all the elements in the selected grou!. I think I might be able to create an UI Block Styler but it could be "painful"

 

Thanks

 

Regards

 

JXB

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)

Re: Accessing .afuManager screen selection

Siemens Phenom Siemens Phenom
Siemens Phenom

I'm not sure what you mean by "full". It sounds like you need a list box to present a list of functions to a user and allow them to select one or more. This can be a BlockStyler dialog with a listbox element. Since you're running .Net, you could also use something like System.Windows.Forms to create a window with a listbox.

Re: Accessing .afuManager screen selection

Phenom
Phenom

yes by "full" I meant the .dlx anf all the .vb code behind it. I have had problem with .dlx files in that there never "found" by the calling programm. To run a .dlx on the official systems means having write access to the NX installation directory which I do not have. I have not found to date a wayof runnign the .dlx from my "home"directory. I have not used System.Windows.Forms a lot except some input/message box. I guess I would have to play with visual express (as it's free) unless there is a easier way to create such listbox. I think getting the list of existing afu records shouldn't be too difficult. I may have some test code somewhere to get the records!

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)

Re: Accessing .afuManager screen selection

Siemens Phenom Siemens Phenom
Siemens Phenom

You should never put customizations in the NX installation hierarchy. There is a structure set up to define Site, User and Group level customizations. UGII_SITE_DIR, UGII_GROUP_DIR and UGII_USER_DIR can each point to a directory. The .dlx file belongs in a folder named 'application' located under one of those folders.

 

For example, create a folder named D:\NX_Open. Set UGII_USER_DIR=D:\NX_Open. The .dlx file belongs in D:\NX_Open\application, i.e. D:\NX_Open\application\myDialog.dlx

 

For more information, see the articles (particularly Environment Variables and Application Directory Structure) in the following section of the NX Programming Tools help:

 

Home > NX Open > NX Open Programmer's Guide > Executing NX Open Automation

Re: Accessing .afuManager screen selection

Phenom
Phenom

Thanks will have a look at this again

 

I have played a bit with the idea of a GUI using Block styler. I created 2 list boxes

  1. Listbox1 will contain the names of all the afu files
  2. Listbox2 will contain the name of the records associated with the afu file selected (in Listbox1). So the data in this list box is “dynamic”

Thinking is as follows;

 

  1. Get list of afu files (in array format. So far I have not found the command to get the afu files associated with a sim. For testing I have hard coded 2 afu files
  2. Display this list in Listbox1,
  3. When user select a AFU file (in ListBox1), program executes code to get the RecordNames associated with AFU and display in ListBox2,
  4. User (multi)selects the records required, and the program execute

I am still to fully understand where to put the appropriate code to "fill" the Listbox

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)

Re: Accessing .afuManager screen selection

Siemens Phenom Siemens Phenom
Siemens Phenom

There is no assoiation between afu and sim files. Note that if you have afu files open in a session then save the sim part and exit when you restart and go to the XY Function Manager there are no AFU files loaded. You must manually browse to the file to open it.

 

Give the attached a try. Update the folder that afuFileDir points to in line 237 to a path appropriate to you system.

 

AfuExample.png

Re: Accessing .afuManager screen selection

Phenom
Phenom

Thanks for that. It is really appreciated. Just spent some time looking at one of the NX provided example it was gettigng a bit frustrating as it is not well documented. Anyway. Your example is very good. I like the Function getAfuRecordNames(). I also undersand how to use the function update_cb() for the 2nd list box. Will have to play with as the dummy GUI I created earlier had a "scale factor" option and a toggle button to combine csv file after creation. For future use so as not to have to re-do the whole GUI once I got a grip with it.

 

Regarding the afuFileDir I planned to use the path of the .sim file as a default

 

Thanks a lot

 

JXB

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)