[more or less solved] NXOpen C/C++ LinkedBody slicing

Hi everyone,

I'm currently working on code for work to take a linked body and trim it into slices using an existing face, however I'm experiencing some problems.

1. Whenever I mix C and C++/Journal code, object data seems to get unloaded in the background. E.g. I pull the data of a DatumAxis, then make a C API call and afterwards the pointer is not NULL, but I get an exception accessing the Origin or Direction properties.

2. I get "update undo happened" errors and cannot identify why. However, what is more important, I noticed that when an exception is thrown, even though I catch it I cannot successfully add previously creates objects to the delete list anymore. That is, I can add them, but they won't be deleted.

Fixing these two issues will probably fix the others as well, so if anyone has advice on how to tackle these I'd be most grateful, already spent quite a few hours with these issues...

Regards,
Dennis

I did not solve the unloading or find out when exactly it happens, however correctly placed feature->makeCurrentFeature() calls for the relevant features seems to do the trick. I also added undo marks to return to valid states after every distinct set of operations. The combination seems to get rid of the problems.