0

I have already written code in C# for UG NX in a .cs file, but I want to use it on NX without having to copy and paste it into NX's Journal.

I have written the code in Visual Studio and tried Ctrl + Shift + B to build the .cs file, but I received an error of:

dotnet not found

Is there a way to compile or use a .cs file into UG NX?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
John Lee
  • 31
  • 1
  • See https://visualstudio.microsoft.com/vs/features/net-development/. You need the .NET Desktop Development Tools installed. –  Oct 27 '21 at 14:13
  • What do you mean by *"compile code into NX"*? Can you elaborate? Preferably, by [editing (changing) your question](https://stackoverflow.com/posts/68722514/edit), not here in comments (***without*** "Edit:", "Update:", or similar - the question should appear as if it was written today). – Peter Mortensen Nov 02 '21 at 22:01

1 Answers1

0

No, you need a .dll or .exe file to run it on NX.

To create a .dll file, create a new project then select Class Library.

After that, you can add your code and when you're finished, press Ctrl + Shift + B to build the .dll file.

Then you can open NX, and press Ctrl + U to run the .dll file.

yoyo159
  • 3
  • 1