×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Link .dll file (journal C#) to .prt file. How to connect it?

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

RE: Link .dll file (journal C#) to .prt file. How to connect it?

Sounds like you need a batch program rather than an interactive NX session. Either use \ugii\run_journal.exe or compile an .exe instead of dll file to open your model, change the values, update the model and then save the part.

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?

(OP)
Thanks for very quick reply.
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources