Surpac Indonesia: TCL and Python Scripting in GEOVIA Surpac, Two Approaches to Mining Automation

Introduction

For geologists, mine planners, and engineers who work with Surpac every day, repetitive tasks are a classic challenge. Creating strings, calculating volumes, compiling block model reports, or organizing survey data are often performed repeatedly with nearly identical steps, taking up time that could otherwise be devoted to more strategic analysis.

To address this, Surpac has long offered scripting capabilities via TCL and has recently begun integrating Python. This article discusses how both approaches work, what the differences are, and how to choose the one that best suits your work needs.

Scripting Examples (Python documents in Surpac, Dassault Systèmes)
Scripting Examples (Python documents in Surpac, Dassault Systèmes)

TCL/SCL: The Foundation of Automation in Surpac

TCL (Tool Command Language) has long been Surpac’s built-in scripting language, commonly used alongside SCL (Surpac Command Language) to call Surpac’s internal functions. This combination forms the basis of Surpac’s macro feature, allowing users to record a series of actions in the GUI (Graphical User Interface) and then replay them (record and playback), or to write TCL scripts manually for more precise control.

Key Features of TCL

  • Native integration. TCL/SCL scripts can directly call Surpac’s core functions—such as string creation, triangulation, volume calculations, and block model manipulation—without requiring additional libraries.

  • Ideal for workflow control logic. Features like the Guido Table enable the creation of interactive forms with dynamic table inputs, which are useful for scripts that handle an unspecified number of user selections.

  • Runs directly from the GUI. Scripts can be executed by right-clicking or dragging and dropping them into the Surpac graphical window, making them easy to share with colleagues.

  • Distinctive learning curve. TCL syntax is quite different from modern programming languages, with relatively limited documentation for beginners.

TCL is typically used for tasks such as automatically opening specific files, running a series of commands to generate monthly volume reports, or standardizing the process of importing survey data from a total station.

Python: A New Chapter in Automation at Surpac

The Surpac ecosystem, under the GEOVIA umbrella (Dassault Systèmes), has recently begun to incorporate Python integration as a complement to TCL. This aligns with a general trend in many engineering software applications, where Python is increasingly being chosen as the language of choice for automation due to its extensive ecosystem and familiarity among a newer generation of engineers.

Advantages of the Python Approach

  • A rich library ecosystem. Python provides access to libraries such as pandas, numpy, matplotlib (and many more) for advanced data analysis that would be far more complex to perform using TCL alone.

  • Broader integration. Python scripts are easier to connect to other systems outside of Surpac, such as enterprise databases, dashboards, third-party APIs, or data science pipelines.

  • Familiar to new talent. Because it is widely taught in colleges and boot camps, new technical staff generally become productive faster than if they had to learn TCL from scratch.

  • Well-suited for complex data analysis. Advanced statistical modeling, machine learning for concentration estimation, or complex data visualization are more naturally performed in Python.

It should also be noted that this integration is a relatively new development and continues to evolve with each new release. For production implementations, please refer to the official GEOVIA documentation corresponding to the version of Surpac you are using.

TCL and Python: When to Use Which??

Aspect TCL/SCL Python
Integration with Surpac Native, long established Evolving, depending on the version
Ease of learning for modern IT beginners More challenging Easier
Advanced data analysis Limited Very Powerful
Surpac internal task automation (macros, forms) Mature Still Developing
Integration with external systems Limited Flexible

A Practical Guide to Choosing

  • Use TCL/SCL for automating routine tasks that occur exclusively within Surpac, creating macros, interactive forms, or workflows that have been running stably for a long time.

  • Use Python when you need to combine Surpac data with advanced analysis, connect it to other systems, or build cross-platform tools.

  • Many teams actually combine both: TCL for proven tasks within Surpac, and Python for the analysis and reporting layers outside of Surpac.

Tips for Getting Started with Automation in Surpac

  1. Start by recording a macro. Use Surpac’s record-and-playback feature, then study the automatically generated TCL script.

  2. Take advantage of official script examples. GEOVIA provides a package of sample TCL/SCL scripts that can be run directly in the Surpac GUI.

  3. Check the latest release documentation for Python. Be sure to refer to the release notes for the version of Surpac used in your company

  4. Build an internal library. Document scripts frequently used by your team as an internal library to avoid rewriting the same logic over and over again.

Conclusion

TCL/SCL remains the backbone of classic automation in Surpac, proven to be mature and reliable for internal macro needs. Meanwhile, Python integration opens up new opportunities for mining teams to connect geological and mine planning data with the world of modern data analysis. The most realistic approach for many teams is to understand the strengths of each language and use them according to the context of the work.

Sources