Convert a C++ Journal File to Compiled Application (C++)
You have a shiney new C++ Journal file, now what?
These steps may focus on C++ but a Visual Basic program can be compiled into an application in a similiar way, also a java file can be compiled into an application, not with Visual Studio but it is possible.
Background Information
NX3 introduced Journaling, You have 3 formats to choose from to create. The formats are Visual Basic (default), C++, and Java. Visual Basic is the only replayable format on Windows format. NX 4 may have the capability to play back journal files on Unix via the Mono framework. Not sure on this until NX4 is released in late 2005.
Set Journal Preference Language
Journaling is a great mechanism to capture design steps then turn it into a program. If you prefer to work in C++ rather then Visual Basic you need to set your journaling preferences to C++ by: Preferences -> User Interface -> Journal (tab) -> Journal Language (section).
Capture Steps
Record the steps your interested in capturing, disclaimer for this version of NX3 and future version of NX until journaling is fully covered. Not all the steps have an action associated to it that relates to a Journaling.
Create Visual Studio NX3 project NX3 uses Visual Studio 2003 (7.1) version
Launch Microsoft Visual Studio .NET 2003
In Visual Studio:
- File -> New -> Project
- Visual C++ Projects (project type)
- Select NX3 Open Wizard (if this does not exist contact us and we’ll help you configure it
- Set the name: testProject
- Set location for your project: C:\Projects\
NX3 Open Wizard
- Overview (section) -> Next
- Application Settings (section) : Verify internal application is selected, and C++ option is selected -> Next
- Entry Points (section): Leave automatically (ufsta) is checked or ufusr is fine, and Automatically, when the application completes -> Finish
Remove the Default cpp source file
In the Solution Explorer in Visual Studio -> Source Files -> remove the testProject.cpp file (right click on the file, remove)
Add your Journal file
In the Solution Explorer in Visual Studio -> Source Files (right click on the file, Add -> Add Existing Item). Navigate to the location you saved your CPP journal file. It will named with the .cxx extension.
It is recomended that you put the journal file you created in the directory of your Visual Studio Project (C:\projects\testProject)
Compile and Build (Debug mode)
In Visual Studio: Build -> Build Solution
Verify that succeeded is 1 and no failures
Save your project and test your application
Test Project
Start NX; File -> Execute -> NX Open…
Navigate to your executable in your Visual Studio Project (C:\Projects\testProject\Debug\testProject.dll)
If everything works out they way you expect, continue on and add your additional functionality. If no additional functionality is needed continue to the next step
Build Release Version
In Visual Studion set your Build mode to Release. Project -> Properties -> Configuration -> Release (option menu) -> Ok. Or through the standard toolbar option.
Build solution
Deploy
Create production directory structure
c:\MyApplication
—startup
—application
put you dll (testProject.dll) in the application directory, you should also package the *.pdb files in there also. Not necessary but may become helpful in the future when debuging on a client machine.
modify the custom_dirs.dat file to point to the top directory (C:\MyApplication)
The custom_dirs file is located at UGII_BASE_DIR/UGII/menus
Summary
This is a very simplified path to creating a custom application. The journalling mechanism does make rapid application development much easier. The steps here are far from all encompasing. This approach is to get the low hanging fruit of an organization and the larger more complex applications take much longer to architect. Please use this as a starting point to get some confidence capturing, building, and deploying. Building off these simple ideas to build more sophisticated automation applications.
One Comment to “Convert a C++ Journal File to Compiled Application (C++)”
Leave a Reply


Thank you for a nice article on the C++ journal.
I had tried it with different journals but didn’t get good results (a lot of errors). But after I had included a header every journal I had made succesfully compiled.
This is a very good way to my mind to learn UGOpenPP.
Thanks a lot!