I'm trying to adapt a User Exit sample from GTAC which I want to be called when the postprocessing menu item is selected within CAM but nothing seem to be happening. From the documentation the entry point is ufpost and the environmental variable is USER_POST which has a value of C:\temp\xxx.dll.
Function ufpost() As Integer
Dim a As Session = Session.GetSession()
MessageBox.Show("Saving: " & a.Parts.Work.FullPath)
ufpost = 1 ' set to 1 to stop the save
Public Function GetUnloadOption(ByVal dummy As String) As Integer
Return CType(Session.LibraryUnloadOption.Immediately, Integer)
Here is what documentation says about that User Exit:
The CLSF postprocess exit occurs after Application→Manufacturing→Toolbox→ Tool Path...→Postprocess→Postprocess. Selecting this option executes both the USER_CL_GEN (CLF generation) and USER_POST (CLSF postprocessing) exits in succession.
It looks to me you would also require this user exit to be defined in your DLL:
Function ufclg(ByVal args As String()) As Integer
Since you only have ufpost defined, I guess NX just fails gracefully when trying to execute the User Exit.
I am not familiar with CAM. Can you attach a simple model where I can hit Post Process without having to correctly define all the prerequisites?
I was not able to make the User Exit work either. But I managed to call a dll after Post Processing has been hit by modifying the menu of CAM. See zip file attached.
The idea is to modify the Post Processing button and to add a POST action which is your NXOpen dll. In order to do so, you will need an NXOpen application directory structure (both application and startup directories) and point to it using UGII_USER_DIR or by modifying the UGII\menus\custom_dirs.dat file.
You quote the documentation as saying this user exit is for CLSF postprocessing, but your istructions say to use NX Post. I suspect this is a legacy function for the old GPM post, but you should check with GTAC.