This question might be a bit more "advanced"? Is it possible to get a user's screen selection? See attached for example. In the simulation navigator if the user selects a few response simulations I'd like to put all the "names" selected into a collector/array (whatever is easier) to carry-out some post processing. If it is easier do to it in the 'XY Function Navigator' then this will work for me too!
You have access to the global selection using UI.GetUI().SelectionManager.GetNumSelectedObjects(); and
The other option you have is to use a Select Object UI Block and query the list of selected objects. You will need to create a dialog to use that option.
No matter what option you choose, you will need some kind of user action to trigger your code. NX Open application code may only be called from a user action, either by selecting a menu item or by explicitly run the NX Open code from the File->Execute menu.
Thanks a lot for that. Would the followign work?
1. User select what is need/wanted
2. click on a custom button which called the appropriate .vb file
3. the .vb file gets all the user selection the proceed with each selection?
For Each UserSelection In myArrayOfSelection
Yes, that approach would work, as long as the global selection gets updated when you select your objects from the tree. I mean by that the Deselect All icon should be active when you select your items from the Navigator.
Thanks. I have found this in the GTAC archive
I have just tested the code in the link above and my selection is not regonised ie it is blank.(numsel = 0). I am working in the 'XY Function Navigator'
As already explained, if the global unselect icon stays grayed out, then whatever you selected is not part of the global selection. I doubt an XY plot selection would work since there is nothing to highlight on the model.
Did you look at the XYPlotManager, which you can obtain an instance from the session using XYPlotManager()? It might be what you are looking for.
I'm not sure how different CAM is, but we provide some vb samples that take actions on the nodes selected in the Operation Naviator. Take a look in UGOPEN\SampleNXOpenApplications\.NET\CAM\ for programs with "OntSelection" in their name.
Thanks for the advice. I am looking at the .vb example and sure enough it's not straightforward (Don't know why SIEMENS issue such a "poor" manual. Maybe they do not want non-software engineer to leverage the tool capability, anyway..)
I do not really understand what the programme is doing but a line which could be of interest is
so will have a look on Monday if there is somethng similar in the 'XY Function Manager'. When I checked after MAYA_'s suggestin there was nothing obvious
Will get back to the forum if I get to the bottom of it