Showing results for 
Search instead for 
Did you mean: 

How to simulate any G-code file in NX CAM

Community Manager Community Manager
Community Manager


A milling program was created outside of the NX CAM application. After editing the G-code file in a text editor, the edits need verification. Below are the steps to simulate the G-code program inside NX CAM using integrated machine tool simuation.


Run simulation


Created with NX 8



1. Create the Part and the Blank geometry. (The Part Geometry is only required if gouge checking is performed.)

Part and Blank Geometry 
2. Create a manufacturing setup and move the MCS to the correct location in reference to the part shape. In the MCS specify a Fixture Offset number of “1” to be used for G54 output. All simulation setups require that an MCS with a Fixture Offset of “1” be present even if unused. If a G55 through G59 are used in the G-code file than an additional MCS will need to be created for each of these. The Fixture Offset value that is entered in the MCS will be 2 through 6, respectively.
Create a manufacturing setup 

3. Load the simulation machine into the part file.
Load machine 

4. When loading the machine specify the “Part Mount Junction” so that the part can be positioned on the simulation machine correctly. Use the “Workpiece Parts” pane to select the part model to be used for Gouge Checking.
Part mount junction 

5. Create all the tools in NX that will be used in the program. Add these tools to the Pocket with the correct Tool Number and then alter the Adjust and Cutcom Registers to match those used in the G-code file. If a Tool, Adjust or Cutcom value is used in the G-code file which cannot be found associated to an NX Tool than an error will be displayed during simulation.
Create tools 

6. Open the “Machine Tool Navigator” and locate the “Workpiece” in the Setup section. Select the model that will be used as blank geometry in the simulation. If any machining fixtures are used, a vise for example, they can be added under “Fixtures”.

Add fixtures

7. To start the simulation go to ‘Tools -> Simulate Machine Code File’ and, when prompted, select the G-code file that will be simulated.


On the “Simulation Control Panel” check “On” the “Show 3D Material Removal” option and press “Play” to simulate. Make sure that a G20 or a G21 is included in the G-code file so that the machine simulates in the correct part units.


Run simulation


Do you have a question?

Click 'Add a Comment' below to ask it. (You must be signed in to use this feature.)


About the Author

Randall Waser, GTAC, Siemens PLM Software

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom


I try to repeat your example, but - not working. Why? 

If I add MSC (local, index=1 for G54) and open sim08_sinumerik_mm example (A-C table, exact as in your example) and try to simulate:



G54 D1

G01 X0 Y0 Z0 F1000. 


Nc Machine going to crazy position. 

But if I use in my proram 



- all working ok.


Whats wrong? Question.pngQ2.png

Siemens Phenom Siemens Phenom
Siemens Phenom

This is a configuration topic. The OOTB Sinumerik examples shows a different behavior and don’t request MCS objects directly from CAM. The OOTB post always creates an INI file including the offset definition like $P_UIFR….

Details can be found in the file Working_with_OOTB_MACH_Simulation_Examples.pdf


Hola se puede simular pero que no  necesariamente te pida la maquina insertada para poder simular el codigo?

I had a simulation problem that when I select machine code simulation, the NX always notices me that some .ini file was not registered. I checked all the documents name still can't find where's the wrong.

These comments are related to the article above. For other questions about machine tool simulation, please contact GTAC or ask in the NX Manufacturing Discussion Forum

LIVE Tech Tip Webinars
Watch NX experts demonstrate manufacturing best practices. Stay online for Q&A.