How to build and run an NXOpen DLL?
SolutionSample Code
1. Under the first //TODO: Add your application code here, enter the code as follows:
Part part;
part = theSession.Parts.Work;
theSession.ListingWindow.Open();
theSession.ListingWindow.WriteFullline(“Name: “ + part.Name);
2. This code will open a window listing the name of the work part.
Building the dll
1. Select Build -> Build Solution.
Obtaining the dll Location
1. On the project tab, right click and select Open Containing Folder.
2. Navigate to the bin, then the folder where the project is built.
- Note: This folder will be either ‘Debug’ or ‘Release’ depending on which type was selected when the solution was built.
3. Copy the path using Ctrl + C.
Launching the dll
1. Open NX.
2. Choose File -> Execute -> NX Open.
3. Paste the path of the dll file.
4. Hit enter.
5. Select the dll file.
6. Click OK.
- Note: The code will now run.