﻿ Python and EnSight

Python and EnSight


Python and EnSight

EnSight contains an embedded Python interpreter.  A few of the interfaces this Python interpreter provides are documented in the EnSight Interface manual and a new user should reference that documentation and the various HowTo documentation examples of EnSight extensions first. The manual covers the original Python "sendmesg()" API also known as the command driver interface as well as the subsequent "Native" API.  In 9.1, CEI developed a more powerful interface known as the Object API. The Object API is not yet complete and many of its features are still subject to change. However, the Object API is used internally and provides a level of access to the EnSight core that is not possible in any other way.  It allows for the development of highly customized tools that are deeply integrated into EnSight. This current state of this API is exposed through the Object API user-defined tool and this document.  This document covers various aspects of the EnSight Python API not covered in the bundled documentation. Note: this site is dynamic and viewers may want to view the site periodically.

Base ensight module

EnSight has a built-in python module named 'ensight' that is loaded by default.  The pages on this website describe a number of the sub-modules of this module.  The base module supports a number of methods as well.  These are covered in the EnSight interface manual.

User-defined Python API Tool

Not all of the various EnSight core object methods and attributes are listed on this website. For a complete list of the classes, their methods and attributes and an example of their visual editing tree, please refer to the user-defined tool: Python Object API.  Here is a screen shot of how to get to the tool and an example page for the ENS_VAR object.

For the most complete examples, make sure that you have loaded a dataset with at least one variable before opening this tool.  The tool lists every attribute of every object type.  The type of the attribute and a number of details about it (e.g. dependencies, read-only status, limits, etc).  This is a critical reference for any EnSight Python Object API developer.