Python Incy Me
Python Incy Me
Tutorial
Using Python® in CYME
– CYME 8.0
A self-contained study file (.sxst) to use with this tutorial is provided. The explanations below are based on the use of it.
2. Python Console
The Python console can be
opened either from the
toolbar of from the menu
option: File >Tools->Python
Console. The following
window should open:
Pub. No.: IL917126EN
Effective: March 2018
From this window simple Python commands can be used, ranging from simple mathematical calculations to the cympy
commands provided with CYME. Type in the following, then press Enter:
1. 2*8
2. cympy.study.QueryInfoNode(‘Distance’, ‘B4’, 3)
The following should appear:
The second command shown is to query the keyword Distance on the node B4 with a precision of 3 decimals.
Note: It is also possible to explore the CymPy Library with the auto complete feature of the tool. By typing “cympy”
followed by a dot, the possible sub-modules, functions or variables will be shown. See the CYME Reference Manual for
more details.
3. Python Toolbox
The Python Toolbox can be used to save and run
scripts. The toolbox is accessed either from the toolbar
or from the menu: File > Tools > Python Toolbox.
The following dialog box should open. It contains a few
sample scripts.
The toolbar available in the dialog box contains the
following options; from left to right:
1. Toolbox options
2. Add Python script to toolbox
3. Modify script properties
4. Remove script from toolbox
5. Run selected script
6. Edit selected script
7. Import/Export Script
8. Search options
Select the Summary Report LF/SC Script and Run it. A
custom report should appear at the end of the
execution. It is also possible to view the script by
selecting the Edit Script option.
Note: If the sample scripts are not showing click on
the Toolbox options button and deselect the Show
only user-defined scripts option.