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
Solved! Go to Solution.
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.
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"
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.
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!
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
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
Thinking is as follows;
I am still to fully understand where to put the appropriate code to "fill" the Listbox
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.
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