Hi everyone,
I have a few days programming Journals for NX in java and right now I'm stuck with a dialog option.
I have a selection dialog created (aside with some buttons) but I can't find the way to add a filter to it so when the dialog pops up to the user he/she is only able to select components (not solid, facets, curves, etc.)
I found the following object within API documentation (addFilterHandler) but I'm having a hard time to give it the adequate variables to make it work.
Below are two parts of the code including what I'm trying to tweak:
---------------
---------------
public static Session theSession = null;
public static UI theUI = null;
static Menu_MoveCSYS theMenu_MoveCSYS;
private String theDialogName;
private nxopen.blockstyler.BlockDialog theDialog;
private nxopen.blockstyler.UIBlock group0;// Block type: Group
private nxopen.blockstyler.UIBlock selection0;// Block type: Selection
private nxopen.blockstyler.UIBlock group01;// Block type: Group
private nxopen.blockstyler.UIBlock button0;// Block type: Button
private nxopen.blockstyler.UIBlock button01;// Block type: Button
private nxopen.blockstyler.UIBlock button02;// Block type: Button
...
..
.
theSession = (Session)SessionFactory.get("Session");
theUI = (UI)SessionFactory.get("UI");
theDialogName = "C:\\ACTIVEPROCESS\\ActiveProcessWorkSpace\\MoveCSYS\\Other\\Menu_MoveCSYS.dlx";
theDialog = theUI.createDialog(theDialogName);
theDialog.addApplyHandler(this);
theDialog.addFilterHandler(BlockDialog.Filter( selection0 , [HERE IS WHERE I DON'T KNOW WHAT TO ENTER]));
/*
* In the API I found the following method for a Dialog:
* BlockDialog.addFilterHandler(BlockDialog.Filter cb)
* Then the BlockDialog.Filter method has the following data:
* it has an int method that needs the selection block (selection0, and some sort of TaggedObject type object):
* int filter(UIBlock selectionBlock, TaggedObject selectedObject);
*/
theDialog.addUpdateHandler(this);
theDialog.addCancelHandler(this);
theDialog.addInitializeHandler(this);
theDialog.addDialogShownHandler(this);
----------
----------
Do you have any idea that may solve this issue? I can't leave it to the user to be able to select other stuff different from components because the program would fail.
Thanks in advance for your help & time!
I have a few days programming Journals for NX in java and right now I'm stuck with a dialog option.
I have a selection dialog created (aside with some buttons) but I can't find the way to add a filter to it so when the dialog pops up to the user he/she is only able to select components (not solid, facets, curves, etc.)
I found the following object within API documentation (addFilterHandler) but I'm having a hard time to give it the adequate variables to make it work.
Below are two parts of the code including what I'm trying to tweak:
---------------
---------------
public static Session theSession = null;
public static UI theUI = null;
static Menu_MoveCSYS theMenu_MoveCSYS;
private String theDialogName;
private nxopen.blockstyler.BlockDialog theDialog;
private nxopen.blockstyler.UIBlock group0;// Block type: Group
private nxopen.blockstyler.UIBlock selection0;// Block type: Selection
private nxopen.blockstyler.UIBlock group01;// Block type: Group
private nxopen.blockstyler.UIBlock button0;// Block type: Button
private nxopen.blockstyler.UIBlock button01;// Block type: Button
private nxopen.blockstyler.UIBlock button02;// Block type: Button
...
..
.
theSession = (Session)SessionFactory.get("Session");
theUI = (UI)SessionFactory.get("UI");
theDialogName = "C:\\ACTIVEPROCESS\\ActiveProcessWorkSpace\\MoveCSYS\\Other\\Menu_MoveCSYS.dlx";
theDialog = theUI.createDialog(theDialogName);
theDialog.addApplyHandler(this);
theDialog.addFilterHandler(BlockDialog.Filter( selection0 , [HERE IS WHERE I DON'T KNOW WHAT TO ENTER]));
/*
* In the API I found the following method for a Dialog:
* BlockDialog.addFilterHandler(BlockDialog.Filter cb)
* Then the BlockDialog.Filter method has the following data:
* it has an int method that needs the selection block (selection0, and some sort of TaggedObject type object):
* int filter(UIBlock selectionBlock, TaggedObject selectedObject);
*/
theDialog.addUpdateHandler(this);
theDialog.addCancelHandler(this);
theDialog.addInitializeHandler(this);
theDialog.addDialogShownHandler(this);
----------
----------
Do you have any idea that may solve this issue? I can't leave it to the user to be able to select other stuff different from components because the program would fail.
Thanks in advance for your help & time!