UFUSR equivalent in VB.NET(How to explicitly run a NX open VB.NetProg)
UFUSR equivalent in VB.NET(How to explicitly run a NX open VB.NetProg)
(OP)
How to explicitly run a NX open VB.Net Prog from outside the NX Tool?
I found the following progaram in C++ for explicitly running a NX open application outside the NX, do we have a VB.NET equivalent for the same ?
*****************************************************************************/
/* Explicit Activation
** This entry point is used to activate the application explicitly, as in
** "File->Execute UG/Open->User Function..." */
extern DllExport void ufusr( char *parm, int *returnCode, int rlen )
{
/* Initialize the API environment */
if( UF_CALL(UF_initialize()) )
{
/* Failed to initialize */
return;
}
/* TODO: Add your application code here */
try{
}//report_parents_of_drafting_curve(curve);
catch (const NXOpen::NXException& ex)
{
// ---- Enter your exception handling code here -----
// NXOpen::UI::GetUI()->NXMessageBox()->Show("UI Styler", NXOpen::NXMessageBox::DialogTypeError, ex.Message());
}
/* Terminate the API environment */
UF_CALL(UF_terminate());
}
I found the following progaram in C++ for explicitly running a NX open application outside the NX, do we have a VB.NET equivalent for the same ?
*****************************************************************************/
/* Explicit Activation
** This entry point is used to activate the application explicitly, as in
** "File->Execute UG/Open->User Function..." */
extern DllExport void ufusr( char *parm, int *returnCode, int rlen )
{
/* Initialize the API environment */
if( UF_CALL(UF_initialize()) )
{
/* Failed to initialize */
return;
}
/* TODO: Add your application code here */
try{
}//report_parents_of_drafting_curve(curve);
catch (const NXOpen::NXException& ex)
{
// ---- Enter your exception handling code here -----
// NXOpen::UI::GetUI()->NXMessageBox()->Show("UI Styler", NXOpen::NXMessageBox::DialogTypeError, ex.Message());
}
/* Terminate the API environment */
UF_CALL(UF_terminate());
}





RE: UFUSR equivalent in VB.NET(How to explicitly run a NX open VB.NetProg)
If you have journal code that is not compiled, you can run it outside of NX with the run_journal utility. More on this can be found in the help at NX Essentials -> Gateway tools -> Journals -> Running a journal from the command prompt window. NX will need to be installed on the computer that the journal is run on.
www.nxjournaling.com
RE: UFUSR equivalent in VB.NET(How to explicitly run a NX open VB.NetProg)
The code above allows explicit activation of the application.
What i mean by explicit activation is double clicking the .exe file and running the code , rather than going through the File --> excecute-->NxOpen way and then selcting the .exe file.
This entry point is used to activate the application explicitly, as in
** "File->Execute UG/Open->User Function..." */
I am aware of user exits
And it looks something like this is VB.NET if am not wrong
Public Function GetUnloadOption(ByVal dummy As String) As Integer
'Unloads the image immediately after execution within NX
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately
'----Other unload options-------
'Unloads the image when the NX session terminates
'GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination
'Unloads the image explicitly, via an unload dialog
'GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Explicitly
'-------------------------------
End Function