Link .dll file (journal C#) to .prt file. How to connect it?
Link .dll file (journal C#) to .prt file. How to connect it?
(OP)
Dear all,
This is a tricky question but I hope some of you have so many non-standard ideas.
I have a journal in C# and I've compiled it into .dll file. This journal changing few dimensions and taking care of logic statements which determine contact surfaces.
As you probably know in Workbench is functionality to perform optimization by parameters. To achieve my goal I need to link this dll (or exe) to my NX part.
In other words:
1) I have a UG baseline model attached to Workbench.
2) I change few dimensions (parameters in Workbench).
3) Workbench open NX and send new values.
4) If change_flag=1 NX call my .dll which do few operations
5) After execution dll my model is updated.
6) Loop is closed when updated model is attached again to Workbench.
Let me summarize. Is there any way to run external dll file from expressions? Or is there any way to link external journal to Part?
Any advice can be valuable.
Thanks & Regards,
Mark
This is a tricky question but I hope some of you have so many non-standard ideas.
I have a journal in C# and I've compiled it into .dll file. This journal changing few dimensions and taking care of logic statements which determine contact surfaces.
As you probably know in Workbench is functionality to perform optimization by parameters. To achieve my goal I need to link this dll (or exe) to my NX part.
In other words:
1) I have a UG baseline model attached to Workbench.
2) I change few dimensions (parameters in Workbench).
3) Workbench open NX and send new values.
4) If change_flag=1 NX call my .dll which do few operations
5) After execution dll my model is updated.
6) Loop is closed when updated model is attached again to Workbench.
Let me summarize. Is there any way to run external dll file from expressions? Or is there any way to link external journal to Part?
Any advice can be valuable.
Thanks & Regards,
Mark





RE: Link .dll file (journal C#) to .prt file. How to connect it?
From NX Open > NX Open Programmer´s Guide > Execution Methods > Executing Batch Applications
"An NX Open application .exe file can be executed directly from a command line as any other executable. Since this is a managed application, you will need to do one of the following:
Copy the NX .NET libraries to your local working directory. To do so, copy all of the libraries from the %UGII_ROOT_DIR%\managed directory to your working directory. Use standard operating system command to execute the application.
Copy your .EXE to UGII_ROOT_DIR\managed. Use standard operating system command to execute the application.
Use run_managed.exe (%UGII_ROOT_DIR%\run_managed.exe)
run_managed is a standalone executable that runs a managed NXOpen .EXE in the correct environment allowing it to pick up other DLLs from the install when they are not in the same directory as the .EXE itself.
usage:
run_managed <executable-file> <arguments>"
Otherwise you should look into converting your program to an UDO feature.
RE: Link .dll file (journal C#) to .prt file. How to connect it?
I will check how run_journal.exe works but I am afraid that such solution won't work with ANSYS parametrization.
Maybe you can say something more how can I convert my program into UDO (any tutorial or similar topic)?
In NX I can only find option "Edit User Defined Object" but how to create it?
Thanks,
Mark