Building Scripting Applications¶
Once setting-up the Python environment properly and getting familiar with the fundamental concept of scripting support, users are now ready to build their own scripting applications. There are two types of scripting applications that are currently supported by the Tool:
- Custom Process: This type of scripting application is not associated with a particular type of Tool functionalities. It is an independent custom process scripted by users to perform specific model manipulation. It is typically designed to perform sophisticated model manipulations not explicitly supported by the Tool, such as, creating a model from various sources, performing network reduction, or merging external network models, etc. The purpose of this type of scripting support is to enable users to rapidly build some model-driven applications by taking full advantage of the underlying support of the Tool. While users have the full control of the custom process, these processes, however, must be invoked from the Tool UI. There is also a scripting support enabling users to build independent Python applications outside of the Tool. But the standalone scripting support is released under an evaluation license.
- Tool Extension: This type of application is designed to extend the existing Tool functionalities by plugging the script-based functions to customize the existing functionalities or the Tool built-in support. For example, users may plug-in script-based functions to perform specific model validation, create custom reports, or perform sophisticated model transformation. The plug-in functions are typically embedded in the meta-data files designed to drive the related model applications.
Basic Python scripting knowledge is needed to build the scripting applications. But Python is a relatively easy programming language. The skill set needed can be rapidly built up through tutoring and practice. A set of sample scripts are provided in this tutorial to help users quickly learn how to build scripting applications. However, it is important to note that these sample applications were not designed to teach users how to program in Python. Users are recommended to read some Python programming tutorials. One of the free resources can be found at http://www.pythonlearn.com/book_007.pdf.
Overview of Subtopics¶
- Building Custom Process
- Example 1: Creating a New Model
- Example 2: Iterating through a Model
- Example 3: Finding Information of Interest
- Example 4: Updating Model Contents
- Extending Tool by Plugging-in Script Functions
- Scripting for Model Validation
- Extending MQL through Scripting
- Building Script-based Report
- Scripting for Model Transformation
- Building Standalone Scripting Applications