GUIDE
How to Import a UG NX or Mastercam Program into SSMAM and Run Your First Simulation
Take a program you posted in UG NX or Mastercam and rehearse it in SSMAM before it touches a real machine: pick the matching post processor, load the G-code, set stock, tools and work offset, and catch the mistakes in simulation.

If you already program parts in UG NX or Mastercam, you do not need to learn a new way of writing G-code to practise 5-axis machining. SSMAM, the CNC simulation and training software from Swansoft, runs the real FANUC 0iM, Siemens 828D and HEIDENHAIN control panels on screen, and it accepts the same posted programs those controls run on a real machine. That means you can take a program you posted for the shop floor, load it into SSMAM, and watch the whole job run on a virtual machine before a single chip is cut.
This guide walks through the full workflow: posting the program in your CAM software, loading it into SSMAM, setting up the stock, tools and work offset to match, and running the simulation so you can trust what it tells you.
What SSMAM Actually Runs
SSMAM does not read your CAM project file. It reads the posted G-code program, the plain text file your post processor produces. UG NX and Mastercam both work the same way: you build the toolpaths in CAM, then the post processor translates them into G-code written for one specific control. The control is the key. A program posted for a FANUC 0iM will not run correctly on a Siemens 828D model in SSMAM, and a program posted for a Siemens control will not run correctly on a FANUC model. The first thing to get right is not in SSMAM at all. It is in your CAM software, in the post processor you choose.
Before you post, check three things in CAM. First, the post processor must match the control of the SSMAM machine model you plan to use: a FANUC post for a FANUC 0iM machine, a Siemens post for a Siemens 828D machine. Second, the machine definition in CAM should match the machine you will simulate: the same rotary axis letters, directions and travel limits. Third, the work offset in CAM must be the same point you will set in SSMAM, usually G54 on the same corner, face or rotary centreline. If any of these three disagree, the simulation will run a program that is wrong for the machine, and the errors will look like simulation bugs when they are really setup mistakes.
Step 1: Post the Program in UG NX or Mastercam
In UG NX, finish your toolpaths, then use the Postprocess command and pick the post processor for your control. In Mastercam, finish your toolpaths, then use the Post command and pick the matching machine definition and post. Either way, save the output as a plain text G-code file. Keep the file name simple and keep the original CAM file open, because you will come back to it when the simulation shows a problem and you need to change a toolpath rather than hand-editing G-code.
Also write down the tool list: the program will call tools like T1, T2 and T3, each expecting a certain diameter and length. You will need it in step 4, because SSMAM simulates with the tools you load into its tool table, not with the tools CAM imagined.
Step 2: Pick the Matching Machine in SSMAM
Start SSMAM and choose a machine model with the same control and rotary structure as the program you just posted: a FANUC 0iM 5-axis model for a FANUC-posted program, a Siemens 828D model for a Siemens-posted one. Do not load a 5-axis program onto a 3-axis machine model. The control will alarm on the rotary commands, and you will have learned nothing.
Inside the 6-day free trial, every machine model is open to you. After the trial, SSMAM falls back to three-axis work and five-axis simulation is locked until you activate the $25 one-time license from the download page, so run a serious 5-axis program while the trial is active, or activate first.
Step 3: Load the Program and Read It on the Panel
Load your G-code file into the control panel, then read it on the panel before you press cycle start. The control will stop at the first line it does not understand, so watch for alarms as the program loads. An alarm on a G-code or an M-code usually means the post processor wrote a code this control does not support. That is a post processor problem, not a simulation problem: fix it in CAM by choosing a different post or turning off the option that wrote the unsupported code, then post again.
Use the program check or graphic display on the panel to look at the toolpath. The shape it draws should look like your part. If it looks mirrored or rotated, the coordinate system in the program does not match the machine, usually because the work offset was set on a different point in CAM than in SSMAM. Do not run the simulation yet. Fix the offset first.
Step 4: Set Stock, Tools and Work Offset to Match CAM
Simulation is only as honest as the setup behind it. Set the stock to the same size and position as in CAM, load the tools from your step 1 list with the same diameters and lengths into the same tool numbers the program calls, then set the work offset, usually G54, on the same point you used in CAM: the same corner, top face, or rotary centreline for 5-axis work.
Tool length is the setting beginners get wrong most often. If the length in SSMAM is shorter than in CAM, the simulation will show the tool cutting air above the part. If it is longer, the simulation will show the tool plunging into the part. Both look like program errors, and both are setup errors. Check each tool against your list before you run.
Step 5: Run Single-Block First, Then Full Speed
Run the program in single-block mode first, stopping at every tool change and every rotary move. At each stop, check the tool position, the table angle, and whether the holder is clear of the fixture and the part. The tool holder is what beginners forget: the cutter is short and the holder is wide, and at a tilted angle the holder can hit the part or the fixture while the cutter is still clear.
Pay special attention to any move where the tool retracts, the table turns, and the tool comes back down: the retract height must clear the part and the fixture at every angle the table passes through, not just at the start and end angles.
When the single-block run looks right, run the whole program at full speed and watch for collisions and alarms. A collision in simulation is a free lesson; on a real machine it is a scrapped part or a broken tool. If the simulation alarms, read the alarm message on the panel first. Most alarms point at a real mistake: a tool number with no tool loaded, a rotary angle beyond the machine limit, or a code the control does not recognise.
Common Import Mistakes, and How to Spot Them
The most common mistake is the wrong post processor. The symptom is alarms on ordinary lines, or a toolpath that looks nothing like the part. The fix is in CAM: post again with the post that matches the SSMAM control. The second mistake is a work offset mismatch: the program cuts in the right shape but in the wrong place, off by a fixed distance. The fix is to set G54 in SSMAM on the same point you used in CAM.
The third mistake is RTCP switched on in one place and off in the other. RTCP, tool center point control, keeps the tool tip on the programmed point while the rotary axes move. If your CAM post outputs RTCP commands and the control in SSMAM has it switched off, or the other way round, the tool will wander away from the part whenever the table tilts. Our RTCP guide explains what the function does and how to check it in SSMAM.
The fourth mistake is tool numbers that do not match. The program calls T5, but tool 5 in SSMAM is a different diameter from tool 5 in CAM, so cuts come out too wide or too narrow by a consistent amount. Load the tools into the same numbers with the same sizes.
From One Imported Program to a Daily Habit
Once this workflow feels routine, it becomes the cheapest quality check in your shop. Post the program, load it into SSMAM, set the stock and tools to match, run it single-block, then run it whole. Ten minutes in simulation can save an hour of setup time and a scrapped part on the real machine.
If you have not installed SSMAM yet, the download page has the free installer, and our install and activation guide covers the steps: download, install, find your 12-digit Machine ID, and activate. The 6-day free trial is enough to run through this whole guide several times; after that, the $25 one-time license keeps five-axis simulation open for good.
Get SSMAM 7.41
The installer is free to download. A registration code is $25, one-time, bound to one machine.