I would like to be able to open an existing part or creating a new part from a GUI in NX.
It seems, it's not allowed. I try to find a work around but it doesn't work.
"Failed to recover original display part. Session may be unstable." And then " Display part is changed during a callback. The dialog should be closed now."
What I do is I call the GUI in a new part. Then in the callback,
Case 1 : close the part and create a new one, do the job, then save the part
Case 2 : close the part and open an exsiting one.
I always get the same problem.
Has any of you found a way to do it ?
The limitations on changing the display part vary a little bit depending on what version of NX you are using, but in both of your workflows, you are closing the part before you do anything else. Once you close all parts, you can't have a Block Styler dialog open. Try leaving your original part open in the session instead of closing it. If that does not resolve your problem, take a close look at the documentation for Block Styler. In the NX9 docs, search for "Changing a displayed part".
As I mentioned, this behavior is different in earlier releases, but here are some notes about NX9 behavior:
You can change a displayed part when a dialog box that is created using Block UI Styler is open. After you perform operations on your part, you can return to the original part.
When you display a secondary dialog box for a change in the displayed part through a callback in the primary dialog box, NX deletes all undo marks if you change the original part.
When you open a dialog box that contains Selection blocks, the Selection blocks display the selection count from the original part, even if the selected objects are not available in the new part. After you revert to the original part, NX highlights objects selected through the Selection blocks in the original part.
When you click the Cancel, OK, or Apply buttons, you get the following results.
Click Cancel immediately after changing the displayed part.
NX closes the dialog box and retains both the original and the new displayed parts.
For a secondary dialog box, NX retains only the original part.
Click Cancel after performing operations which create new objects or session updates.
NX closes the dialog box.
You can undo operations performed only in the new part if a secondary dialog box is displayed.
NX closes the dialog box and displays the original part.
NX closes the dialog box, displays the original part and then reopens the dialog box.
I'm working on the NX10 version now.
Would it be a new way to deal with the display part changing with a GUI open ?
I would like to have only a Next button and a Close button.
How could I trick the GUI to make it thinks the Next Button is an Apply ?
I am trying to use the apply callback to open a new FEM/SIM file from a part but it doesn't work properly.
I managed to create a new FEM/SIM file but the GUI closed and when I try to exit NX I received errors from NX "Encountered an improper argument" and then NX freezes.
I have to kill the process at the end.
There must be something I'm doing wrong but I don't know what.
Someone could help me ?