Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IRstuff on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

NX Journal

graberic

Computer
Jun 4, 2025
4
Hello,
New to creating an NX Journal. Prob something dumb here but I cannot get past this. This should rotate all the step files in a folder by a matrix.
I get a dreaded C+ error.
Line 1 : A namespace cannot directly contain members such as fields or methods
 

Attachments

  • Rotate.txt
    7 KB · Views: 9
Replies continue below

Recommended for you

What version of NX are you using? Your code references some properties on the Step214Importer object that I don't think exist.
 
Your AI helper is hallucinating properties and methods that don't exist in the NXOpen API.
 
yea that makes sense. So much for ChatGPT.
I tried the lazy way out.
Thanks for the confirmation.
 
Yup, the NXOpen API is too "exotic" for AI for it to generate code reliably (not enough questions about it on Stack Overflow I guess). You can get a good structure, but the actual methods that do the stuff you want are just electric sheep.

Also, the code is in Basic, if you're getting a C# error from it, that looks like an AI prompt problem. ;-)
 
I'm actually ok with VB. The Journal editor wants to make it a .cs file, which it treats entirely different, like C# I guess.
I can rename the file to .vb and I get a host of different errors.
It looks like I am going to need find the NXOpen API documentation and actually read it.
Does anyone have a link to the API methods?
 

Part and Inventory Search

Sponsor