I wrote code to export a PDF file from an NX file. When I run it for a single file everything is Ok.
Then I try to use this code through a bunch of files (over a for loop), Everything is fine. But sometimes when I try to change the target files, it throws an exception on the BasePart:
basePart1 = theSession.Parts.OpenActiveDisplay(SourceFilePath, DisplayPartOption.AllowAditional, out _);
After that error, I have to reopen the project and run it from scratch, always the problem doesn't show again. But when I try to open another bunch of files, usually the problem shown again. How can I handle it?