Automating Eureka 3X with Python

Verify programs without touching the UI: open a project, load the setup, simulate, and read the results — from a script

Everything else in Eureka 3X Pro is driven from the interface. But there's a second way in: Eureka exposes a COM automation API you can drive from Python (via win32com), which means verification can become a programmatic step rather than a manual one. That opens up things the UI can't:

  • Batch-verify a whole folder of NC programs unattended.
  • Integrate verification into a pipeline — a script that verifies every program before it's released, and fails the build if a collision is found.
  • Feed an automated or AI-driven workflow — generate a program, verify it against a real machine model, and read a pass/fail back in code (the verification half of the "AI proposes, Eureka verifies" loop).

This is a developer-oriented walkthrough. It assumes Eureka 3X installed on Windows and basic Python. Every call below is from the real Eureka automation API.


1. Connect to the application

Eureka registers a COM automation object, Eureka.Application. You either attach to a running instance or launch a new one:

import win32com.client
import os, time

# Launch (or attach with GetActiveObject) the Eureka COM application
eureka = win32com.client.Dispatch("Eureka.Application")

# Wait until the application is ready
while eureka.AppStatus == 0:
    time.sleep(1)

# Optional: make the window visible and maximized (3), or keep it hidden for headless runs
eureka.Visible = 3

The top-level Application object is the entry point to everything: Options, Simulation, the active project, and application-level properties like EurekaVersion and Licensed.


2. Configure run options

Before simulating unattended, you want Eureka to not stop and wait for a human — no dialog boxes, no "simulation finished" prompt, no pausing on the first collision. The Options object controls this:

options = eureka.Options
options.TerminateOnError     = False   # don't abort the process on an error
options.EndSimulationMessage = False   # no "simulation complete" popup
options.RebuildStockOnRestart = 2      # always rebuild stock, without asking
# For fully unattended runs, also consider:
# options.DisableMessageBoxes = True
# options.DoNotStopOnError    = True

These are the difference between a script that runs to completion on its own and one that hangs waiting for a click.


3. Open a project

A Eureka project (.epf) carries the machine, controller, and setup. Open it through the application:

folder = os.getcwd()
epf_path = os.path.join(folder, "dmu70.epf")

# OpenProject(fullPath, bLoadMainProgram, bLoadShapes)
project = eureka.OpenProject(epf_path, 1, 1)

The returned project object is where the rest of the setup happens — programs, shapes (stock/design/fixtures), tools, and the verification settings.


4. Select the NC program

Point the project at the program you want to verify. This works for any NC file the project's controller understands — posted or hand-written:

program_path = os.path.join(folder, "29PE1101904.H")

# SelectProgramFile(filePath, controllerIndex, xmlOptions)
project.SelectProgramFile(program_path, 0, "")

To batch-verify, this is the line you loop over: same project, many programs.


5. Load the stock (and design / fixtures)

Shapes — stock, design model, fixtures — are added into the project tree and then tagged for what they are. Here we clear the template workpiece, load a stock STL, and mark it as stock:

# Remove the placeholder workpiece shapes
project.RemoveShape("dmu70.Workpiece.*")

# AddFileShape(name, parentNode, filePath, x, y, z, rotz, roty, rotx, xmlOptions)
stock_path = os.path.join(folder, "stock.stl")
project.AddFileShape("stock", "dmu70.Workpiece", stock_path, 0, 0, 5, 0, 0, 0, "")

# Tag it as the stock model
project.SetShapeAsStock("dmu70.Workpiece.stock")

The same pattern loads the rest of the setup — the API distinguishes each role explicitly:

# A design/finished model, tagged for stock-vs-design comparison:
project.AddFileShape("design", "dmu70.Workpiece", design_path, 0, 0, 5, 0, 0, 0, "")
project.SetShapeAsFinished("dmu70.Workpiece.design")

# A fixture is just another shape under the appropriate node:
project.AddFileShape("clamp", "dmu70.Fixture", fixture_path, 0, 0, 0, 0, 0, 0, "")

Shapes can also be built parametrically instead of loaded from files — AddCubeShape, AddCylinderShape, AddExtrudedShape, AddRingShape, and more — which is handy for generating simple stock from bounding-box dimensions without a CAD file.

Tools and work origins come with the project or its controller setup; tools can also be loaded through LoadTools(machineID, toolListName, xmlTools), and datums/frames placed with AddFrame(...). In many workflows the project already carries the tool library and work offsets, so the script only swaps the program and the stock.


6. Set verification behavior and units

Turn on the checks you want to run, and set units to match the program:

project.CollisionDetection = True   # enable collision checking
project.Units = 0                   # 0 = MM, 1 = INCHES

7. Run the simulation — headless

The Simulation object runs the check. Passing a non-visualizing mode lets it run without drawing every frame, which is what you want for batch/headless verification:

# Simulation.Start(mode, async, options_flags)
# Run synchronously (async = False) so the script waits for completion.
eureka.Simulation.Start(1, False, 8)   # 8 = simulate without visualization

Because async=False, the call returns when the run finishes, and the results are ready to read. (For a progress-driven UI you'd run async and poll Simulation.Phase / GetChannelProgress.)


8. Read the results

This is the payoff — automation is only worth it if you can get a machine-readable verdict back out. The project exposes error and warning counts directly:

print("Errors:  ", project.ErrorCount)
print("Warnings:", project.WarningCount)

For a pass/fail gate, that's often all you need. For detail, iterate the collisions — each one tells you which two shapes touched and at what point in the program:

# project.Messages exposes the log; collisions carry shape + program-counter detail
for i in range(project.Messages.Count):
    msg = project.Messages.Item(i)
    print(msg.Text)

And persist a full log for the record — useful as an audit artifact or a CI attachment:

project.SaveLogs(os.path.join(folder, "log.txt"))

You can also export a formatted report with project.ExportReport(reportName, folder, fileName), and — because stock-vs-design comparison is scriptable too — run a correctness check with the MachinedStockVsDesignModelComparison interface's Compare(designShape, stockShape) to catch gouges and excess material programmatically, not just crashes.


9. Clean up

eureka.Simulation.Terminate()
eureka = None          # release the COM reference
# eureka.Quit()        # or fully close the application

Putting it together: a batch verifier

The real value shows up when you wrap steps 4–8 in a loop — one project, a folder of programs, a pass/fail per file:

import glob

results = []
for nc in glob.glob(os.path.join(folder, "programs", "*.nc")):
    project.SelectProgramFile(nc, 0, "")
    project.RestartSimulation(False)          # rebuild + re-run for this program
    eureka.Simulation.Start(1, False, 8)
    ok = (project.ErrorCount == 0)
    results.append((os.path.basename(nc), ok, project.ErrorCount, project.WarningCount))
    print(f"{'PASS' if ok else 'FAIL'}  {os.path.basename(nc)}  "
          f"errors={project.ErrorCount} warnings={project.WarningCount}")

# Fail the pipeline if anything didn't verify clean
if any(not ok for _, ok, _, _ in results):
    raise SystemExit("Verification failed for one or more programs")

That's an unattended gate: no program leaves the office without a clean, controller-accurate simulation behind it — enforced in code.


Where this fits

Scripted verification turns Eureka 3X Pro from a tool you open into a step you automate. For a production cell it means every program is checked without anyone remembering to check it. For a team experimenting with generated or AI-drafted G-code, it's the verification half of the loop — the program gets simulated against a real machine model and returns a pass/fail before anything runs, in code. The controller-accurate twin doing the checking is the same one you'd use interactively; the API just lets a script drive it.

Want to build verification into your pipeline? Start with a single project and the script above, point it at your programs, and read back ErrorCount. From there it's a short step to an unattended gate that verifies every program before it reaches a machine.

Eureka 3X Pro — 30-day free trial, no credit card required.

The methods and properties above are from the Eureka automation API; consult the API reference shipped with your installation for the full object model and exact parameter details for your version.


FAQ

What does the Eureka automation API let me do?
Drive Eureka programmatically: open a project, select an NC program, load and tag stock/design/fixture shapes, set verification options, run the simulation (including headless, without visualization), and read results — error and warning counts, collisions, logs, reports, and stock-vs-design comparison.

What language and technology is it?
It's a COM automation interface. The natural way to drive it from Python is win32com.client.Dispatch("Eureka.Application"). It runs on Windows, where Eureka 3X runs.

Can I run it headless / unattended?
Yes. Set the options that suppress dialogs and end-of-run prompts (for example EndSimulationMessage = False, TerminateOnError = False), and start the simulation in a non-visualizing mode. The run completes without human interaction, which is what makes batch verification possible.

How do I get a pass/fail out of it?
Read project.ErrorCount after the run — zero errors is a clean verification. For detail, iterate the messages/collisions, save a log with SaveLogs, or export a report with ExportReport.

Can it check the part is correct, not just crash-free?
Yes — the stock-vs-design comparison is scriptable via the comparison interface's Compare method, so you can catch gouges and excess material programmatically alongside collision checking.

Is this the foundation for AI / agentic verification?
Effectively, yes. An automated or AI-driven workflow that generates programs can call this API to verify each one against a real machine model and read back a result — the "generate, then verify before running" pattern, in code.


Run every G-code program risk-free — before it touches your machine.

Try Eureka 3X Pro Risk-Free

Run every G-code program risk-free — before it touches your machine.