ANSYS ACT Developers Guide PDF
ANSYS ACT Developers Guide PDF
ANSYS ACT Developers Guide PDF
ANSYS, Inc.
Southpointe
2600 ANSYS Drive
Canonsburg, PA 15317
[email protected]
http://www.ansys.com
(T) 724-746-3304
(F) 724-514-9494
Release 17.1
April 2016
ANSYS Customization ANSYS Customization Suite
ANSYS, Inc. is
certified to ISO
9001:2008.
Disclaimer Notice
THIS ANSYS SOFTWARE PRODUCT AND PROGRAM DOCUMENTATION INCLUDE TRADE SECRETS AND ARE CONFIDENTIAL AND PROPRIETARY PRODUCTS OF ANSYS, INC., ITS SUBSIDIARIES, OR LICENSORS. The software products
and documentation are furnished by ANSYS, Inc., its subsidiaries, or affiliates under a software license agreement
that contains provisions concerning non-disclosure, copying, length and nature of use, compliance with exporting
laws, warranties, disclaimers, limitations of liability, and remedies, and other provisions. The software products
and documentation may be used, disclosed, transferred, or copied only in accordance with the terms and conditions
of that software license agreement.
ANSYS, Inc. is certified to ISO 9001:2008.
Third-Party Software
See the legal information in the product help files for the complete Legal Notice for ANSYS proprietary software
and third-party software. If you are unable to access the Legal Notice, Contact ANSYS, Inc.
Published in the U.S.A.
Table of Contents
Introduction ............................................................................................................................................... 1
Customizing ANSYS Products .................................................................................................................. 1
Direct Product Customization ........................................................................................................... 2
Process Compression and Automation .............................................................................................. 3
Licensing ................................................................................................................................................ 3
Migration Notes ..................................................................................................................................... 4
Changes to the Wizard API ................................................................................................................ 4
Changes to the Project API ............................................................................................................... 4
Known Issues and Limitations ................................................................................................................. 5
Defining Extensions ................................................................................................................................... 7
Creating a Scripted Extension ................................................................................................................. 7
ExtSample Extension: XML Extension Definition File .......................................................................... 8
ExtSample Extension: IronPython Script ............................................................................................ 9
ExtSample Extension: Directory Structure/File Hierarchy .................................................................... 9
ExtSample Extension: Exposure in the Application ........................................................................... 11
Extension Libraries ......................................................................................................................... 12
Building a Binary Extension ................................................................................................................... 13
Configuring Extension Options ............................................................................................................. 17
Additional Extension Folders Option ............................................................................................... 18
Save Binary Extensions with Project Option ..................................................................................... 18
Journal Wizard Actions Option ....................................................................................................... 18
Debug Mode Option ....................................................................................................................... 18
Using Extensions ...................................................................................................................................... 21
Using the ACT Start Page ...................................................................................................................... 21
Accessing the ACT Start Page .......................................................................................................... 21
ACT Start Page Interface ................................................................................................................. 22
Using the Extension Manager ............................................................................................................... 23
Extension Manager Accessed via the ACT Start Page ........................................................................ 24
Extension Manager Accessed via Extensions Menu .......................................................................... 25
Installing and Uninstalling Extensions ................................................................................................... 26
Installing a Scripted Extension ........................................................................................................ 26
Uninstalling a Scripted Extension .................................................................................................... 27
Installing a Binary Extension ........................................................................................................... 27
Uninstalling a Binary Extension ....................................................................................................... 28
Loading and Unloading Extensions ....................................................................................................... 29
Configuring Extensions to be Loaded by Default ............................................................................. 30
Extension Capabilities .............................................................................................................................. 33
Common Capabilities ........................................................................................................................... 33
Defining Toolbars and Toolbar Buttons ............................................................................................ 33
Binding Toolbar Buttons with ACT Objects ...................................................................................... 36
Defining Pop-up Dialogs ................................................................................................................. 37
Storing Data in Your Extension ........................................................................................................ 38
ACT-Based Properties ........................................................................................................................... 39
Creating Property Groups ............................................................................................................... 39
Using PropertyGroup and PropertyTable ................................................................................... 39
Using Templates to Create Property Groups ............................................................................... 43
Parameterizing Properties ............................................................................................................... 43
Common Property Parameterization Processes .......................................................................... 44
Parameterizing Properties in ANSYS Workbench ........................................................................ 45
Parameterizing Properties in ANSYS Mechanical ........................................................................ 46
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
iii
iv
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
vi
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
vii
viii
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Introduction
ANSYS ACT is the unified and consistent tool for the customization and expansion of ANSYS products.
Using ACT, you can create extensions to customize ANSYS Workbench, ANSYS AIM, or other supported
ANSYS applications (such as Mechanical, DesignModeler, Fluent, Electronics Desktop, and DesignXplorer).
This guide offers an introduction to ACT, discussing its capabilities and showing how to use them. It is
primarily intended for developers of ACT extensions, but also provides information for the end users
who will be managing and/or using the extensions.
Basic examples, each written and tested on all Windows platforms, are used to illustrate different types
of customization in each supported ANSYS product.
Note
The development of extensions requires some knowledge of IronPython and XML. For extensions that customize the ANSYS solver, knowledge of APDL is also required.
Related topics:
Customizing ANSYS Products
Licensing
Migration Notes
Known Issues and Limitations
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Introduction
Engage the ANSYS simulation ecosystem through integration and custom workflow techniques, enabling your business-specific elements to co-exist and interface with pre-built ANSYS solutions.
Encapsulate existing features and processeseither those native to ANSYS products or ones derived
from a third-party toolinto cohesive, automated simulation workflows.
Integrate third-party tools by creating new features based on the tool or by leveraging existing thirdparty functionality.
Where to Start
To begin developing extensions, start with the general instructions provided in Defining Extensions (p. 7).
To begin using an extension youve created, review the general information provided in Using Extensions (p. 21).
For general and application-specific information on direct product customization, see Extension Capabilities (p. 33).
For information on process compression and automation, see ACT Simulation Wizards (p. 125).
To review sample extensions for supported ANSYS products, see Examples (p. 199).
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Licensing
Licensing
ACT development is licensed, but binary extension usage is not. In other words, developers creating
new extensions must have a license. However, once the extension is built, a license is not required to
run it.
The ACT license enables two main capabilities, which are:
The ability to build an extension in the Binary Extension Builder. The ACT license is checked out when the
build is launched and is released once the build has been completed.
The ability to load a scripted extension. As a consequence, only the binary extensions can be loaded when
no ACT license is available. No matter the number of scripted extensions that are loaded, only one ACT license
is checked out. This license is released once all the scripted extensions have been unloaded from the Extension Manager.
Note
If an ACT license is already checked out by a loaded scripted extension, the build operation
will not require a second ACT license to run.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Introduction
Migration Notes
This section provides information you will need when migrating from version 17.0 to version 17.1.
Note
Additional items may be published in the "ANSYS ACT 17.1 Migration Notes" document. You
can access this document in the ANSYS ACT Application Store, accessed via the Downloads
tab of the ANSYS Customer Portal.
Now, the method CreateDialog still exists, but the component okCancelDialog does not. In order
to create an OkCancelDialog, you must call CreateOkCancelDialog, as follows:
comp = step.UserInterface.Panel.CreateOKCancelDialog("MyDialog",
"MyTitle", 400, 150)
comp.SetOkButton("Ok")
Context
This is the framework-level command context. It provides additional entry points to the session and project
utilities, and is accessed as follows:
context = ExtAPI.DataModel.Context
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
17.1 Replacement
container
container = task.InternalObject
context
context = ExtAPI.DataModel.Context
For example, if youd created a custom task whose pre-17.1 update signature was:
def update(container, context):
In 17.1, you would change the signature and add the following two statements:
def update(task):
container = task.InternalObject
context = ExtAPI.DataModel.Context
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Introduction
[...] Unable to cast COM object of type 'System.__ComObject' to
interface type 'Ansys.Common.Interop.WBPropertyBrowsing.IAnsProperty'.
[...]
To ensure that a method call occurs from the thread, you must call the method with:
ExtAPI.Application.InvokeUIThread(f, a)
This will execute f with the argument a in the UI thread, enabling you to use the automation API.
Additionally, you should not use the automation API when you are implementing callbacks that are
not executed in the UI thread. If you receive an error, you can check whether your call is executed
in the UI thread as follows:
1. Use the following property in your callback implementation:
System.Threading.Thread.CurrentThread.ManagedThreadId
2. Call this in the ACT Console and verify that you get the same ID.
For your reference, the following callbacks are not executed in the UI thread:
onGenerate
onEndEvaluate
onStartEval
onStartPost
onEndEval
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Extensions
With ACT, you can define extensions in two different formats: scripted and binary.
Scripted extensions
Scripted extensions are comprised of an XML extension definition file and an IronPython script (and any
supporting files, such as help or input files). Callbacks in the XML file invoke the functions or methods
defined in the script.
Binary extensions
Binary extensions (also called "compiled extensions") result from the build of a scripted extension. Developers
create scripted extensions and then compile them into a binary extension (WBEX file). The binary extensions
can be shared with end-users, who will be able to apply the extension but will not be able to view or edit
its contents.
An ACT license is required to create and build an extension, but not required to execute extensions.
For more information, see Licensing (p. 3).
Note
When creating an extension, you will use the IronPython language to develop the functions
used to execute the extension. The following links provide documentation on the IronPython
language:
IronPython documentation
Python reference book
Related Topics:
Creating a Scripted Extension
Building a Binary Extension
Configuring Extension Options
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Extensions
In this section, we'll use a very simple example to demonstrate how to define a scripted extension. We'll
use an extension called ExtSample to customize the ANSYS Mechanical application, adding a singlebutton toolbar to the interface of the Mechanical application. When this button is clicked, a dialog box
will appear and display the following message: High five! ExtSample1 is a success!
Note
Depending on the application to be customized, the content of the extension will differ, but
the basic organization of an ACT extension remains consistent with the example presented.
Related Topics:
ExtSample Extension: XML Extension Definition File
ExtSample Extension: IronPython Script
ExtSample Extension: Directory Structure/File Hierarchy
ExtSample Extension: Exposure in the Application
Extension Libraries
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Defining Extensions
Figure 1: Extension Directory Structure/File Hierarchy
Figure 2: Extension Folder Content (p. 10), shows the contents of the extension folder ExtSample1. The
IronPython script sample1.py contains the script needed to fulfill the behavior of the example extension; the images folder contains the icon file used by the GUI of the extension.
Figure 2: Extension Folder Content
Figure 3: Images Folder Content (p. 11) shows the contents of the images folder. The icon file hand.bmp
is used by the example extension to expose the specific button from the toolbar.
10
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
The open extension log shown below shows that the ExtSample1 extension was initialized for the
Mechanical application context.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
11
Defining Extensions
Figure 5: ExtSample1 Extension Log
Extension Libraries
As you develop extensions to integrate customizations in the application, you can use additional libraries
to share Python functions between extensions. Some libraries are installed by default with ACT to help
developers customize the application.
Supported libraries related to the Mechanical application are located in the following folder:
%ANSYSversion_DIR%\..\Addins\ACT\libraries\Mechanical
Supported libraries related to the AIM application are located in the following folder:
%ANSYSversion_DIR%\..\Addins\ACT\libraries\Study
The libraries included with ACT are described below:
ansys.py
Provides helpers to generate an APDL command block.
chart.py
Provides helpers to generate charts, such as curves and histograms.
units.py
Provides a set of generic functions to convert data from one unit system to another.
wbjn.py
Provides a tool to communicate data to and from the Workbench project page.
12
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
In the Extension Manager accessed via the ACT Start Page, select Build from an extension's drop-down
menu.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
13
Defining Extensions
Figure 7: Accessing the Binary Extension Builder via the Extension Manager
14
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
15
Defining Extensions
Can't copy extension to project: The extension is not saved with the project and is not shared
with other users with the project.
Note
The extension can be sent in addition to the project. The process for saving extensions within
a project is described in Configuring Extensions to be Loaded by Default.
These security options only apply if the user wants to save the extension with the project,
and are otherwise not applicable.
When all parameters are defined, the Build button becomes enabled.
4. Click the Build button to launch the build.
While the build is in progress, the bottom part of the window displays build information, as illustrated
below.
Figure 10: Building a Binary Extension
Note
The appearance of the builder tool will vary according to how you have accessed it, but
the parameters are the same.
16
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
17
Defining Extensions
Note
The default folders are not searched recursively, so store your extensions at the top level of
the directory; extensions stored in subdirectories will not be found.
During this process, warning messages are returned for any conflicts; these messages are also logged
in the ACT log file.
18
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
19
20
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Using Extensions
ACT can manage an entire set of extensions for different ANSYS applications. When extensions are used
for multiple target applications, each extension provides its own customization level. However, the end
user can define a personal configuration based on the extensions previously loaded in ANSYS Workbench,
ANSYS AIM, or the target application of choice. Consequently, the level of customization is directly dependent on the choices the end user makes prior to opening the customized application.
Once a project using an ACT extension has been created and saved, any further use of the project must
integrate any previously used extensions. If these extensions are available, then Workbench loads the
extensions automatically when the project is opened. If an expected extension has not been detected,
an error message is displayed. For more information about controlling the availability of extensions,
see Configuring Extension Options (p. 17).
Related topics:
Using the ACT Start Page
Using the Extension Manager
Installing and Uninstalling Extensions
Loading and Unloading Extensions
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
21
Using Extensions
Figure 13: Accessing the ACT Start Page from Workbench or AIM
To access the ACT Start Page from a standalone instance of Electronics Desktop, click the View >
Wizards menu.
For more information, see the documentation of the standalone application.
Figure 15: Accessing the ACT Start Page from Electronics Desktop
22
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Note
Both versions offer the same capabilities.
The Extension Manager provides a list of all the extensions that have been installed and are available
to be loaded. For information on how the list is populated, see Additional Extension Folders Option (p. 18).
Both scripted and binary extensions are included in the list, but scripted extensions are listed only if
you have an ACT license. You can view the name, type, and version specified in the XML extension
definition file. When defined, an icon and description are also available.
The following sections address both versions of the Extension Manager tool:
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
23
Using Extensions
Extension Manager Accessed via the ACT Start Page
Extension Manager Accessed via Extensions Menu
The Extension Manager shows all of the extensions that are currently installed (scripted extensions
are listed only if you have an ACT license). The green extensions are the ones that have already been
loaded. The following general functionality is available:
Click one of the "+" icons to install a new binary extension.
Click the gear icon to add a directory in which ACT will search for extensions, as described in Additional
Extension Folders Option (p. 18).
Click the ANSYS Application Store button to access extensions available for download on the ANSYS Customer Portal.
Click the arrow icon to return to the ACT Start Page.
24
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
25
Using Extensions
Figure 18: Extension Manager Accessed via the Extension Menu
The Extension Manager shows all of the extensions that are currently installed (scripted extensions
are listed only if you have an ACT license), along with the type and version for the extension. The following functionality is available:
Check or clear the Loaded check box to load or unload the extension.
Right-click an extension to open a context menu showing the options available for that extension.
Load / Unload
Allows you to load or unload the extension.
Load as Default / Do not Load as Default
Allows you indicate that the extension should or should not be loaded to the project by default. When
you specify that an extension should be loaded by default, it is automatically loaded to the project
(either existing or new) when ANSYS Workbench or the corresponding application is launched. For more
information, see Configuring Extensions to be Loaded by Default (p. 30).
Uninstall
Available only for unloaded binary extensions. Allows you to uninstall a binary extension.
Use the Search field to find a specific extension.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Note
The Uninstall option on the Extension Manager is applicable only to binary extensions.
In the Extension Manager (accessed via the ACT Start Page), click one of the "+" icons.
2. Browse to the binary extension () WBEXfile you want to install.
3. Select the WBEX file and click Open.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
27
Using Extensions
Extensions installed this way are located in the current user's Application Data folder and are
available for loading in the Extension Manager.
Note
When a binary extension is installed, a new folder is created in addition to the WBEX file.
Both the folder and the WBEX file are necessary for compatibility with ACT. If you need
to move this new extension to a different folder, make sure that both the folder and the
WBEX file are copied at the same time to the same folder.
28
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Note
This process for uninstalling extensions is only available for binary extensions.
Note
The loading is automatic for extensions that have already been loaded and saved to the
project. Any extensions to be automatically loaded must be available to the Extension
Manager. If a required extension is not available, an error message is displayed.
Wizards that will be run in standalone instances of SpaceClaim or Electronics Desktop (i.e.
when Workbench and AIM are not installed) must be loaded via the Extension Manager
accessed on the ACT Start Page.
In the Extension Manager accessed via the ACT Start Page, you can also load or unload an extension
simply by clicking the extension.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
29
Using Extensions
You can also load or unload an extension as follows:
1. Open the Extension Manager.
2. Access the option to load or unload the extension in one of the following ways:
For either version of the Extension Manager, right-click the extension to open its context menu and
select Load or Unload.
3. For the legacy version (accessed via the Extensions menu), you can check or uncheck the check box to
the left of the extension.
Figure 21: Loading or Unloading an Extension
30
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
31
Using Extensions
Figure 23: Extensions to be Loaded by Default
32
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Extension Capabilities
In the introductory chapter, the sample extension ExtSample1 was used to describe the fundamental
elements of an extension. The ExtSample1 extension demonstrated how to create a toolbar which
contains a button that responds by calling a Python scripted function. This chapter expands on this
description and introduces the main capabilities an extension can address.
This chapter divides extension capabilities in to the following categories:
Common Capabilities
ACT-Based Properties
Capabilities for ANSYS Mechanical
Capabilities for ANSYS DesignModeler
Capabilities for ANSYS DesignXplorer
Capabilities for Custom ACT Workflows in Workbench
Capabilities for ANSYS AIM
Common Capabilities
ACT provides customization capabilities that are common to all target applications: ANSYS Mechanical,
ANSYS DesignModeler, ANSYS DesignXplorer, ANSYS AIM, and ANSYS Workbench.
This section discusses the following common capabilities:
Defining Toolbars and Toolbar Buttons
Binding Toolbar Buttons with ACT Objects
Defining Pop-up Dialogs
Storing Data in Your Extension
33
Extension Capabilities
<toolbar name="ToolBar1" caption="ToolBar1">
<entry name="TB1Button1" icon="button1Red">
<callbacks>
<onclick>OnClickTB1Button1</onclick>
</callbacks>
</entry>
<entry name="TB1Button2" icon="button2Red">
<callbacks>
<onclick>OnClickTB1Button2</onclick>
</callbacks>
</entry>
<entry name="TB1Button3" icon="button3Red">
<callbacks>
<onclick>OnClickTB1Button3</onclick>
</callbacks>
</entry>
</toolbar>
<toolbar name="Toolbar2" caption="Toolbar2">
<entry name="TB2Button1" icon="button1Blue">
<callbacks>
<onclick>OnClickTB2Button1</onclick>
</callbacks>
</entry>
<entry name="TB2Button2" icon="button2Blue">
<callbacks>
<onclick>OnClickTB2Button2</onclick>
</callbacks>
</entry>
<entry name="TB2Button3" icon="button3Blue">
<callbacks>
<onclick>OnClickTB2Button3</onclick>
</callbacks>
</entry>
</toolbar>
</interface>
</extension>
The ExtToolbarSample extension adds two toolbars, Toolbar1 and Toolbar2. Each toolbar has
three buttons, as shown in Figure 24: User-Defined Toolbars in Mechanical (p. 34).
Figure 24: User-Defined Toolbars in Mechanical
The XML example defines two toolbar elements. Each element starts with a begin tag <toolbar
name="..." caption="..."> and ends with a terminal tag </toolbar>. The toolbar element
has two attributes, name and caption. The name attribute is required and is used for internal references.
The caption attribute is the text displayed in the application.
34
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Common Capabilities
The button entry elements define the buttons in the toolbar. Each button entry element starts with
a begin tag <entry name="..." icon="..."> and ends with a terminal tag </entry>. The
entry element has two attributes: name and icon. The name attribute is required and is used for
internal references. The name is also displayed as a tooltip. The icon attribute is the name of the icon
file mapped on to the button.
The entry element for each button is parent to a callbacks element. The <callbacks> element
encapsulates element(s), which are named on the basis of an event. For instance, the name specified
by the onclick element, <onclick>name</onclick>, provides the name of the Python function
to be called when the button is selected.
Referring again to the XML in the above code, the second line:
<script src="toolbarsample.py" />
defines the name of the Python script file for the ExtToolbarSample extension, toolbarsample.py,
the contents of which are shown below. By default, ACT will look for the Python script file in the directory
of the extension. If the Python script file is located in a different directory, an explicit path to the file
must be inserted into the extension XML file.
import os
import datetime
clr.AddReference("Ans.UI.Toolkit")
clr.AddReference("Ans.UI.Toolkit.Base")
from Ansys.UI.Toolkit import *
def init(context):
ExtAPI.Log.WriteMessage("Init ExtToolbarSample ...")
def OnClickTB1Button1(analysis):
LogButtonClicked(1, 1, analysis)
def OnClickTB1Button2(analysis):
LogButtonClicked(1, 2, analysis)
def OnClickTB1Button3(analysis):
LogButtonClicked(1, 3, analysis)
def OnClickTB2Button1(analysis):
LogButtonClicked(2, 1, analysis)
def OnClickTB2Button2(analysis):
LogButtonClicked(2, 2, analysis)
def OnClickTB2Button3(analysis):
LogButtonClicked(2, 3, analysis)
def LogButtonClicked(toolbarId, buttonId, analysis):
now = datetime.datetime.now()
outFile = SetUserOutput("ExtToolbarSample.log", analysis)
f = open(outFile,'a')
f.write("*.*.*.*.*.*.*.*\n")
f.write(str(now)+"\n")
f.write("Toolbar "+toolbarId.ToString()+" - Button "+buttonId.ToString()+" Clicked. \n")
f.write("*.*.*.*.*.*.*.*\n")
f.close()
MessageBox.Show("Toolbar "+toolbarId.ToString()+" - Button "+buttonId.ToString()+" Clicked.")
def SetUserOutput(filename, analysis):
solverDir = analysis.WorkingDir
return os.path.join(solverDir,filename)
Each button in ExtToolbarSample has a unique callback function. Each callback function passes the
toolbar ID and the ID of the button pressed to the function LogButtonClicked, which stores them
in the variables toolbarId and buttonId. These variables are referenced within the function where
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
35
Extension Capabilities
their string values are written. The functions LogButtonClicked and SetUserOutput demonstrate
how to reduce redundant code in callbacks using utility functions. The Analysis object is passed to
each <entry> callback and then used in the SetUserOutput function to query for the working
directory of the analysis. The script in toolbarsample.py makes use of the datetime namespace
from the .NET framework. The datetime namespace exposes a class also called datetime. LogButtonClicked invokes datetime to query the current date and time and stores the result in the variable
name now. The str() utility is used to extract the string definition of the variable now to write out
the date and time.
As an example, if the ACT button is bound with an ACT load in Mechanical, then this button is activated
only if the object is selected in the Mechanical environment; otherwise it is inactive.
In the same way, if the ACT button is bound with an ACT result in Mechanical, this button is active only
if the object is selected in the solution; otherwise it is inactive.
For any ACT object bound to a button, the <onclick> callback is not used.
Based on the above example, Figure 25: Selecting an Environment Object (p. 37) and Figure 26: Selecting
a Solution Object (p. 37) illustrate the GUI behavior based on selection of an object in the tree.
36
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Common Capabilities
Figure 25: Selecting an Environment Object
In addition to the control provided by the connection between the ACT button and the ACT object,
the <canadd> callback can be implemented to add new criteria to be considered for the activation
and deactivation of the button. If the <canadd> callback of the object returns false, the associated
button is deactivated. A typically example consists of filtering a particular analysis type to activate a
specific load.
37
Extension Capabilities
<entry name="DialogSample1" caption="GetFilename">
<callbacks>
<onclick>GUIToolbarOpenFile</onclick>
</callbacks>
</entry>
</toolbar>
</interface>
</extension>
The callback function specified in the XML for the GetFilename menu button is GUIToolbarOpenFile.
Here is the Python script from the file dialogsample.py.
clr.AddReference("Ans.UI.Toolkit")
clr.AddReference("Ans.UI.Toolkit.Base")
from Ansys.UI.Toolkit import *
def init(context):
ExtAPI.Log.WriteMessage("Init ExtDialogSample ...")
def GUIToolbarOpenFile(analysis):
filters = "txt files (*.txt)|*.txt|All files (*.*)|*.*"
dir = "c:\\"
res = FileDialog.ShowOpenDialog(ExtAPI.UserInterface.MainWindow, dir, filters, 2,
"ExtDialogSample","")
if res[0]==DialogResult.OK:
message = str("OPEN selected -> Filename is "+res[1])
else:
message = "CANCEL selected -> No file"
MessageBox.Show(message)
38
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
ACT-Based Properties
Attributes are created or edited with the method:
Attributes["attribute_name"] = attribute_value
Note that an attribute associated with an extension can be shared between applications using the same
extension. For example, two Mechanical sessions can share data.
The command to store the attribute in a shared repository is as follows:
ExtAPI.ExtensionMgr.CurrentExtension.SetAttributeValueWithSync("MyData", 2.)
In the same way, the command to retrieve the content stored in a shared repository is:
ExtAPI.ExtensionMgr.CurrentExtension.UpdateAttributes()
v = ExtAPI.ExtensionMgr.CurrentExtension.Attributes["MyData"]
ACT-Based Properties
ACT has the ability to create customized objects that encapsulate ACT-based properties. This section
discusses how to use ACT to create properties.
The following capabilities are discussed:
Creating Property Groups
Parameterizing Properties
Defining DesignXplorer Properties
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
39
Extension Capabilities
PropertyGroup and PropertyTable are special types of properties that can be used to create
groups of properties with a given caption. In this way, it is possible to manage dependencies between
properties and to create worksheet views from a property.
The PropertyGroup node of the XML file encapsulates a list of child properties under one group.
The PropertyTable node of the XML file encapsulates a list of child properties under one table. Each
child property creates a new column in the table and the user is able to control the line number of this
table.
These functionalities are demonstrated into the AdvancedProperties extension.
The first example shows how to create a group of properties with a caption. The group can be collapsed
or expanded by the user. The Simple group with caption group is shown below.
Figure 27: Details Pane with Group Definition
caption" display="caption">
/>
/>
/>
The property group has a special attribute, display. In this case, this attribute is set to caption,
which means all the children properties are displayed under the caption. If the caption attribute is
omitted, then the display attribute is set to hidden and the property group is hidden.
The second example illustrates how to show or hide properties according to the value of another selected
property.
As shown in Figure 28: Contextual Content for Groups (p. 41), the visibility of the properties is dependent
on the value of the Group Select property as defined above.
40
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
ACT-Based Properties
Figure 28: Contextual Content for Groups
This group is created with the following XML code, which creates dependencies between properties:
<propertygroup name="Group2" caption="Another group" display="caption">
<propertygroup name="Group3" caption="Group Select" display="property" control="select"
default="Option 1">
<attributes options="Option 1,Option 2,Option 3" />
<property name="Prop1" caption="Prop For Option 1" visibleon="Option 1" control="text" />
<property name="Prop2" caption="Prop For Option 1 and Option 2"
visibleon="Option 1|Option 2" control="text" />
<property name="Prop3" caption="Prop For Option 3" visibleon="Option 3" control="text" />
</propertygroup>
</propertygroup>
In this case, the attribute display is set to property. The PropertyGroup Group3 defines a
standard ACT property which provides additional capabilities for all the children properties.
Each child property can specify an attribute visibleon which can take a value or a set of values. If
the current value of the parent property fits with the visibleon attribute, then the property is displayed; otherwise, the property is hidden.
The example below demonstrates how to create properties that open a worksheet each time the user
needs access to the content of the properties. The PropertyTable type is used for such an application.
This type of property is of particular interest as it allows you to create a worksheet that exposes a set
of properties for your customization.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
41
Extension Capabilities
In order to facilitate the development, ACT already provides some predefined worksheets. Two different
types of worksheets are currently available:
Time-dependent worksheet: The row number of this worksheet is initialized with the number of steps
defined in the AnalysisSettings object. If the user of the extension adds or removes time steps
in the AnalysisSettings object, the worksheet is automatically updated. Consequently, this type
of worksheet represents an efficient way to manage time-dependent data within an extension.
Figure 29: Time-Dependent Worksheet
In this example, the display attribute is set to worksheet. In addition, the class attribute is used
to specify the name of the IronPython class that is used to manage the worksheet. For this given application, the TFTabularData class is used. This class is defined in the file TimeFreqTabularData.py
located into the libraries/Mechanical/Worksheet folder, which is part of the standard ACT
installation.
The properties Step and Time integrate a specific treatment, as they are automatically populated with
the information specified in the AnalysisSettings object. These two properties are optional.
Non-fixed row dimension worksheet: For the second type of worksheet, the array is empty by default.
The user can add a new line by clicking on the top left button as illustrated below.
Figure 30: Non-Fixed Row Dimension Worksheet
42
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
ACT-Based Properties
<propertytable name="Worksheet" caption="Non-Fixed row count" display="worksheet" control="applycancel"
class="Worksheet.PropertyGroupEditor.PGEditor">
<propertygroup name="TempOrPres" caption="TempOrPres" display="property" control="select"
default="Temperature">
<attributes options="Temperature,Pressure" />
<property name="Temperature" caption="Temperature" unit="Temperature" control="float"
visibleon="Temperature"></property>
<property name="Pressure" caption="Pressure" unit="Pressure" control="float"
visibleon="Pressure"></property>
</propertygroup>
<property name="Scoping" caption="Scoping" control="scoping">
<attributes selection_filter="face|edge" />
</property>
<property name="FileName" caption="FileName" control="fileopen">
<attributes filters="Command files (*.bat)|*.bat|All files (*.*)|*.*" />
</property>
</propertytable>
In this example the PGEditor class is used. The PGEditor class is defined in the file PropertyGroupEditor.py, available in the /libraries/Mechanical/Worksheet folder.
You can access the content of the worksheet in the same manner as you do any other standard ACT
property.
First, a name is given to the template. The class SelectCoordinateSystem associated with this
template is defined in the file select.py, located in the /libraries/Mechanical/templates
folder. A template has to be made of one single property. If several properties need to be defined, then
they have to be integrated in a group. The template scoping illustrates a template definition with
different properties.
In order to link this template to a property, the user just needs to fill the control attribute of the
property with the name of the template.
Other examples are available in the file /templates/Mechanical/controltemplates.xml.
Parameterizing Properties
When defining ACT properties in ANSYS Workbench or the ANSYS Mechanical and DesignModeler applications, you can also define the property value as either an input or an output parameter (all ACT
parameters are inputs, unless you specify otherwise in the definition). Once parameterized, the property
is in added to the ANSYS Workbench Parameter Set, where it behaves and is treated as any other
parameter.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
43
Extension Capabilities
You can incorporate parameters in a variety of places in your analysis.
In ANSYS Workbench, parameters can be defined for custom task-level properties in the Project Schematic
workflow.
In ANSYS Mechanical, parameters can be defined for any ACT object, regardless of its location in the tree.
In ANSYS DesignModeler, parameters can be incorporated into a number of custom ACT-based features,
such as renaming selected bodies, specifying geometry generation details like as material, dimensions, etc.
In a third-party solver implemented by ACT, parameters can be incorporated into the load, analysis settings,
and result.
All combinations of ACT-based and standard parameters are supported:
ACT input(s) and standard output(s)
ACT input(s) and ACT output(s)
Standard input(s) and ACT output(s)
The following parameterization topics are discussed:
Common Property Parameterization Processes
Parameterizing Properties in ANSYS Workbench
Parameterizing Properties in ANSYS Mechanical
Parameterizing Properties in ANSYS DesignModeler
Parameterizing Properties in a Third-Party Solver
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
ACT-Based Properties
When the user has finished setting up the system and has finished working with parameters and design
point values (there should be at least one input and one output parameter), he can solve the problem
by updating the design points from the Parameter Set.
In the same way, the following code segment creates and enables parameterization for a task-level
output property named Output. Because it is an output property, the readonly attribute is set to
true. The property will also have a control type of integer.
...
<propertygroup name="Outputs">
<property name="Output" caption="Output" control="integer" default="0" readonly="True"
visible="True" persistent="True" isparameter="True" />
</propertygroup>
...
A custom DataSquares system is created on the Project Schematic. The new properties are shown in
the custom Inputs and Outputs sections (as defined by the taskgroups) exposed in the task properties.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
45
Extension Capabilities
When you select the Parameterize checkbox for the two properties, they are added to the Parameter
Set.
For a more detailed examination of this example, see Custom, Lightweight, External Application Integration with Custom Data and Remote Job Execution (p. 217).
Note
Other tags such as default, isload, etc. could be added, as well.
The isparameter tag adds a check box to the user interface, making it possible for the user to select
the property for parameterization.
Once the property has been selected for parameterization, it will automatically be displayed in both
Outline of All Parameters and the Table of Design Points in the Parameter Set.
46
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
ACT-Based Properties
The code sample below is extracted from the XML file of the extension used in the previous example.
You can see how the property definition of our float_unit property is incorporated into the file.
<load name="CustomPressure" version="1" caption="CustomPressure" icon="tload" support="false"
isload="true" color="#0000FF">
<callbacks>
<getsolvecommands order="1">writeNodeId</getsolvecommands>
</callbacks>
<property name="Geometry" caption="Geometry" control="scoping">
<attributes selection_filter="face"/>
</property>
<property name="float_unit" caption="float_unit" control="float" unit="Pressure" isparameter="true"/>
</load>
Note
Other tags such as default, isload, etc. could be added, as well.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
47
Extension Capabilities
Again, the user must select the check box provided by the ACT tag to actually parameterize the property.
Once the property has been selected for parameterization, the corresponding output will automatically
be generated in the Outline of All Parameters table in the Parameter Set.
In addition, by default the minimum and maximum values of an ACT result object are available to become
output parameters. This capability is not managed by the ACT extension, but takes advantage of the
Mechanical environment.
The resulting check box next to the Length property allows the user to parameterize Length as an input
parameter.
48
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
ACT-Based Properties
You could add a static structural analysis based on the previous Geometry template by adding an
output parameter in the Static Structural analysis. This results in the schematic workflow shown below:
The input parameter defined in ANSYS DesignModeler will be managed in exactly the same way as
other any other input parameter. In the Outline of All Parameters table in Parameter Set, the geometry
input parameter will be placed under the Geometry system.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
49
Extension Capabilities
The following code segment, placed under the solver section of the XML definition file, defines the
Max. Iterations parameter.
<solver
<property name="MaxIter" caption="Max. Iterations" control="integer" isparameter="true" default="10"/>
</solver>
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
ACT-Based Properties
Optionally, settings can be placed together in groups. Each group must be declared and defined in the
XML file as a <propertygroup> element under <sampling> or <optimizer> element.
For a description of common attributes and callbacks, see property" under the XML Tags" section of
the ANSYS ACT API Reference Guide for DesignXplorer. For more information on settings groups, see
"propertygroup" in ANSYS ACT XML Reference Guide.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
51
Extension Capabilities
Figure 32: DesignXplorer Properties View for External DOE
In Figure 33: DesignXplorer Properties View for External Optimizer (p. 52) below, we can see the Properties view when the external optimizer named Python Optimizer is selected.
Figure 33: DesignXplorer Properties View for External Optimizer
By default, properties are shown under the General category. If a propertygroup is specified, the
corresponding category is created in the property view. The properties under the General and the respective Status categories are specific to the external method and are defined in the XML file.
52
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
ACT-Based Properties
Note that if the sampling supports the LogFile capability, the Log File property is automatically
defined under the Status category of the Properties view. Once the sampling is generated optimization
has been run, the user can view the log file in a dialog box by clicking on the available link.
In the following optimization example, the minimum value is 2 and the maximum value is 200.
<property name="MyNumberOfSamples" caption="My Number of Samples" control="integer" default="50">
<attributes min="2" max="200"/>
</property>
The advanced attribute is used to classify the property as an advanced option. Advanced options are
visible for the user only if activated (in the Workbench user interface, open Tools > Options > Design
Exploration and select the Show Advanced Options check box). The following example is applicable
to either type of DX extension.
<property name="MyRandomNumber" caption="My Random Number provider" control="select"
default="Python">
<attributes options="Python,CLibrary" advanced="true"/>
</property>
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
53
Extension Capabilities
DOE Example
The following example shows how to control the visibility of the PropForSingleInput property
with a callback coded in IronPython:
<property name="PropForSingleInput" caption="My Property for single input parameter"
control="text">
<callbacks>
<isvisible>isVisibleForSingInput</isvisible>
</callbacks>
</property>
Optimization Example
The following example shows how to control the visibility of the PropForSingleObjective property
with a callback coded in IronPython:
<property name="PropForSingleObjective" caption="My Property for single-objective optimization"
control="text">
<callbacks>
<isvisible>isVisibleForSOO</isvisible>
</callbacks>
</property>
54
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
DOE Example
This example shows how you can modify the values of the max attribute of the property NumberOfLevels when input parameters are edited by the user.
Given the partial sampling definition:
<sampling >
<callbacks>
<InputParametersEdited>InputParametersEdited</InputParametersEdited>
</callbacks>
<property name="NumberOfLevels" caption="Number of Levels" control="integer" default="3"/>
<attributes min="1">
</property>
</sampling>
The InputParametersEdited function is called when input parameters are edited by the user. It
calculates the new minimum allowed value for the NumberOfLevels property from the current
number of input parameters and then sets this value to the max attribute.
Optimization Example
This example shows how you can modify the values of the min attribute of the property MyNumberOfSamples when input parameters are edited by the user.
Given the partial optimizer definition:
<optimizer >
<callbacks>
<InputParametersEdited>InputParametersEdited</InputParametersEdited>
</callbacks>
<property name="MyNumberOfSamples" caption="My Number of Samples" control="integer" default="50" />
</optimizer>
The InputParametersEdited function is called when input parameters are edited by the user. It
calculates the new minimum allowed value for the MyNumberOfSamples property from the current
number of input parameters and then sets this value to the min attribute.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
55
Extension Capabilities
</load>
</simdata>
</extension>
The definition of the load is encapsulated by the <simdata> begin and end tags. The attributes in
the <load> begin tag provide the name, version, caption, icon, and color that apply to this load. The
56
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
57
Extension Capabilities
Note that the two properties, Select (static) and Select (dynamic), use a select control type. The
first property populates the list of options from the XML, while the second one defines an <onactivate> callback. This callback, which is called when the control is activated, populates the available options
for the property. This second approach allows a full control on the options to be exposed in the dropdown menu and makes the list of options dependent on the current status of the project. Many different
situations that can impact the content of the list of options can be addressed, as long as they are implemented in the <onactivate> callback.
The next property, Double, does not require the definition of one specific callback. Instead, the XML
definition introduces a physical quantity dependency with the unit option; this option specifies that
this property is consistent with a length. In addition, default value of 1 [m] is introduced with the default option. This default value is exposed in the Details pane each time a new load is created.
Here is the Python script file main.py used for the DemoLoad extension.
import os
def init(context):
ExtAPI.Log.WriteMessage("Init DemoLoads...")
def CreateDemoLoad(analysis):
analysis.CreateLoadObject("DemoLoad")
def StringOptions_DL(load,prop):
prop.ClearOptions()
prop.AddOption("X")
prop.AddOption("Y")
prop.AddOption("Z")
def GetPreCommands_DL(load, stream):
stream.Write("/COM, **************************************************" + "\n")
stream.Write("/COM, Load properties from DemoLoad getprecommands event" + "\n")
stream.Write("/COM, Text Property = " + load.Properties["Text"].ValueString + "\n")
stream.Write("/COM, SelectDynamic Property = " + load.Properties["SelectDynamic"].ValueString + "\n")
stream.Write("/COM, SelectStatic Property = " + load.Properties["SelectStatic"].ValueString + "\n")
stream.Write("/COM, Double Property = " + load.Properties["Double"].ValueString + "\n")
stream.Write("/COM, **************************************************" + "\n")
def GetSolveCommands_DL(load, stream):
stream.Write("/COM, **************************************************" + "\n")
stream.Write("/COM, Load properties from DemoLoad getsolvecommands event" + "\n")
stream.Write("/COM, Text Property = " + load.Properties["Text"].ValueString + "\n")
stream.Write("/COM, SelectDynamic Property = " + load.Properties["SelectDynamic"].ValueString + "\n")
stream.Write("/COM, SelectStatic Property = " + load.Properties["SelectStatic"].ValueString + "\n")
stream.Write("/COM, Double Property = " + load.Properties["Double"].ValueString + "\n")
stream.Write("/COM, **************************************************" + "\n")
def GetNodalValuesForDisplay_DL(load, nodeIds):
dval = load.Properties["Double"].Value
coordselect = load.Properties["SelectDynamic"].ValueString
mesh = load.Analysis.MeshData
values = []
for id in nodeIds:
node = mesh.NodeById(id)
dispval = float(0.0)
if coordselect == "X":
dispval = node.X * float(dval)
elif coordselect == "Y":
dispval = node.Y * float(dval)
elif coordselect == "Z":
dispval = node.Z * float(dval)
else:
dispval = float(0.0)
values.Add(dispval)
return values
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
59
Extension Capabilities
Figure 35: Customized Context Menu Options
As illustrated above, you can also add a Generate context menu option. This option derives from the
standard Generate action provided by Mechanical. For that reason, the declaration of this particular
option differs from the declaration of the options Action1 and Action2. This option is always associated
with the Clear Generated Data option.
These options allow you to create a load that can mimic a standard Imported Load. The callback associated with the Generate option replaces the standard function integrated in Mechanical.
The feature is activated when you define the callback <ongenerate> for the load.
The <ongenerate> callback will be called each time the user clicks on the Generate context menu
item, as well as when the user solves, if the state of the load is set to "not solved."
As for the standard Imported Load object, the <ongenerate> callback will be called only if the mesh
is already generated.
<callbacks>
<ongenerate>generate</ongenerate>
<oncleardata>clearData</oncleardata>
<action name="a1" caption="Action 1" icon="update">action1 </action>
<action name="a2" caption="Action 2" icon="update">action2 </action>
</callbacks>
60
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
The <ongenerate> callback takes two arguments: the load object and a function to manage a progress
bar. This function takes also two arguments: the message to display and the value (between 0 and 100)
of the progress bar.
During the process, the generated data is stored using an attribute on the property Expression. For
more information, see Storing Data in Your Extension (p. 38).
The <oncleardata> callback takes one argument: the load object. This callback is called each time
the mesh is cleaned or when the user selects the Clean Generated Data context menu option.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
61
Extension Capabilities
Following are the contents of the DemoResult.xml file, which adds a result to a project. As in previous
examples, the XML begins by defining the extension with a version and name attribute. The path to
the Python script file demoresult.py is specified by the <script></script> tag. The <interface> tag defines the toolbar and buttons. The callback function named Create_WPS_Result is
used to create and add the result to the simulation environment.
<extension version="1" minorversion="0" name="DemoResult">
<script src="demoresult.py" />
<interface context="Mechanical">
<images>images</images>
<callbacks>
<oninit>init</oninit>
</callbacks>
<toolbar name="Stress Results" caption="Extension: Worst Principal Stress">
<entry name="Worst Principal Stress" icon="result">
<callbacks>
<onclick>Create_WPS_Result</onclick>
</callbacks>
</entry>
</toolbar>
</interface>
<simdata context="Mechanical">
<result name="Worst Principal Stress" version="1" caption="Worst Principal Stress" unit="Stress"
icon="result" location="elemnode" type="scalar">
<callbacks>
<evaluate>WPS_Eval</evaluate>
</callbacks>
<property name="Geometry" caption="Geometry" control="scoping"></property>
</result>
</simdata>
</extension>
The definition of the result is encapsulated by the <simdata> begin and end tags. The attributes in
the <result> begin tag provide the name, version, caption, icon, and unit that apply to this result.
The result <callbacks> tag encapsulates the single callback <evaluate> used for the evaluation.
The tag <evaluate> gives the name of the Python function that will be called to compute the result
when the application (i.e. presently ANSYS Mechanical) requests an evaluation. The output of this
function is sent directly to Mechanical to display the result.
Below the callbacks definition, you can define the properties that are applied to the actual result
definition. These properties are displayed in the Details pane of ANSYS Mechanical when the user has
selected the result in the Outline pane.
Figure 36: Properties in the Details Pane (p. 63) shows that each property appears in the Details pane
of ANSYS Mechanical with the corresponding names and result values.
62
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Below are the contents of the Python script file demoresult.py, the script file used for the DemoResult extension. The functions Create_WPS_Result and WPS_Eval are critical to the behavior and
application of the result.
The Create_WPS_Result function creates and adds the result to the simulation environment.
The WPS_Eval function is called during solution or when the results need to be re-evaluated.
The callback function Create_WPS_Result is used to create the result and add it to the simulation
environment. This function uses Python dot notation, which allows you to chain objects with methods
that return objects to each other. In the expression analysis.CreateResultObject("Absolute
Principal Stress"), the IAnalysis object analysis is given in argument of the callback. This IAnalysis
object calls the CreateResultObject method. From CreateResultObject, the XML is interpreted
and the internal mechanisms are set into motion to add the details and register the callbacks that define
the results framework. For more comprehensive descriptions of the API objects, methods and properties,
see the ANSYS ACT API Reference Guide.
The WPS_Eval function is called when the result needs to be evaluated or re-evaluated, depending
on the state of the simulation environment. The function definition requires the input arguments result
and step and the output argument collector. Result is the result object for this result and stepInfo
is an IStepInfo object that gives information on the step currently prescribed in the details.
WPS_Eval queries for the component stresses at each node of elements. The stress tensor is used the
compute the three principal stresses (eigenvalues), and then the signed maximum value over these
three is stored as the final result for each node of element. WPS_Eval also deals with the conversion
of units. DemoResults uses a utility library called units, which is imported at the beginning of the
demoresults.py file. With this library, WPS_Eval can derive a conversion factor for the stress units
that is consistent with the units used during solution. Note that the result to be returned by the evaluRelease 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
63
Extension Capabilities
ation function must be consistent with the international system of unit. Then the potential useful conversion to the current unit system in the application is done internally by ANSYS Workbench. Whenever
the result values for Worst Principal Stress are needed for display purposes, ANSYS Mechanical uses
directly the output of the function WPS_Eval. The two callbacks and their registration to the event
infrastructure of ANSYS Mechanical make possible the full cycle of result definition, creation, evaluation,
and display.
import units
wps_stress = {}
eigenvalues = {}
def init(context):
ExtAPI.Log.WriteMessage("Init Demoresult Extension...")
def Create_WPS_Result(analysis):
ExtAPI.Log.WriteMessage("Launch Create_WPS_Result...")
analysis.CreateResultObject("Worst Principal Stress")
# This function evaluates the specific result (i.e. the Absolute principal stress) on each element
required by the geometry selection
# The input data "step" represents the step on which we have to evaluate the result
def WPS_Eval(result,stepInfo,collector):
global wps_stress
analysis = result.Analysis
ExtAPI.Log.WriteMessage("Launch evaluation of the WPS result: ")
# Reader initialization
reader = analysis.GetResultsData()
reader.CurrentResultSet = stepInfo.set
# Get the stress result from the reader
stress = reader.GetResult("S")
# Unit sytem management:
# First get the unit system that was used during the resolution
# Second compute the coefficient to be used so that the final result will be returned in the
SI unit system
unit_stress = stress.GetComponentInfo('X').Unit
conv_stress = units.ConvertUnit(1.,unit_stress,"Pa","Stress")
# Get the selected geometry
propGeo = result.Properties["Geometry"]
refIds = propGeo.Value.Ids
# Get the mesh of the model
mesh = analysis.MeshData
#Loop on the list of the selected geometrical entities
for refId in refIds:
# Get mesh information for each geometrical entity
meshRegion = mesh.MeshRegionById(refId)
elementIds = meshRegion.ElementIds
# Loop on the elements related to the current geometrical entity
for elementId in elementIds:
# Get the stress tensor related to the current element
tensor = stress.ElementValue(elementId,"X;Y;Z;XY;XZ;YZ")
# Get element information
element = mesh.ElementById(elementId)
nodeIds = element.CornerNodeIds
values = []
# Loop on the nodes of the current element to compute the Von-Mises stress on the element nodes
for i in range(0,nodeIds.Count):
local_wps = WPS(tensor[6*i:6*(i+1)])
# Final stress result has to be returned in theSI unit system
local_wps = local_wps * conv_stress
values.Add(local_wps)
collector.SetValues(elementId, values)
# This function computes the absolute principal stress from the stress tensor
# The Von-Mises stess is computed based on the three eigenvalues of the stress tensor
def WPS(tensor):
64
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
# This function computes the three eigenvalues of one [3*3] symetric tensor
EPSILON = 1e-4
def EigenValues(tensor):
global eigenvalues
eigenvalues = []
a
b
c
d
e
f
=
=
=
=
=
=
tensor[0]
tensor[1]
tensor[2]
tensor[3]
tensor[4]
tensor[5]
ACT introduces a new method to facilitate the development of Python functions to evaluate simulation
results. The third output argument collector is internally initialized based on the content of the scoping
property. When defined, this property contains the list of FE entities on which results are evaluated.
This information can be used directly in Python functions without looping over mesh regions. The following demonstrates the use of this method in the function WPS_Eval.
import units
wps_stress = {}
eigenvalues = {}
def init(context):
ExtAPI.Log.WriteMessage("Init Demoresult Extension...")
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
65
Extension Capabilities
def Create_WPS_Result(analysis):
ExtAPI.Log.WriteMessage("Launch Create_WPS_Result...")
analysis.CreateResultObject("Worst Principal Stress")
# This function evaluates the specific result (i.e. the Absolute principal stress) on each element
required by the geometry selection
# The input data "step" represents the step on which we have to evaluate the result
def WPS_Eval(result,stepInfo,collector):
global wps_stress
analysis = result.Analysis
ExtAPI.Log.WriteMessage("Launch evaluation of the WPS result: ")
# Reader initialization
reader = analysis.GetResultsData()
reader.CurrentResultSet = stepInfo.Set
# Get the stress result from the reader
stress = reader.GetResult("S")
# Unit sytem management:
# First get the unit system that was used during the resolution
# Second compute the coefficient to be used so that the final result will be returned in the
SI unit system
unit_stress = stress.GetComponentInfo('X').Unit
conv_stress = units.ConvertUnit(1.,unit_stress,"Pa","Stress")
# Loop on the elements related to the collector.Ids list
for elementId in collector.Ids:
# Get the stress tensor related to the current element
tensor = stress.ElementValue(elementId,"X;Y;Z;XY;XZ;YZ")
# Get element information
element = mesh.ElementById(elementId)
nodeIds = element.CornerNodeIds
values = []
# Loop on the nodes of the current element to compute the Von-Mises stress on the element nodes
for i in range(0,nodeIds.Count):
local_wps = WPS(tensor[6*i:6*(i+1)])
# Final stress result has to be returned in theSI unit system
local_wps = local_wps * conv_stress
values.Add(local_wps)
collector.SetValues(elementId, values)
# This function computes the absolute principal stress from the stress tensor
# The Von-Mises stess is computed based on the three eigenvalues of the stress tensor
def WPS(tensor):
# Computation of the eigenvalues
eigenvalues = EigenValues(tensor)
# Extraction of the worst principal stress
wplocal_stress = eigenvalues[0]
if abs(eigenvalues[1])>abs(wplocal_stress):
wplocal_stress = eigenvalues[1]
if abs(eigenvalues[2])>abs(wplocal_stress):
wplocal_stress = eigenvalues[2]
# Return the worst value of the three principal stresses S1, S2, S3
return wplocal_stress
# This function computes the three eigenvalues of one [3*3] symetric tensor
EPSILON = 1e-4
def EigenValues(tensor):
global eigenvalues
eigenvalues = []
a
b
c
d
66
=
=
=
=
tensor[0]
tensor[1]
tensor[2]
tensor[3]
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
This extension takes advantage of the fact that the collector.Ids property is initialized with the element
numbers related to the selected geometrical entities. This list can be used to evaluate results for each
element. The collector.Ids property contains nodes or element numbers depending on the type
of result defined in the XML file of the extension. For results with the location set to node, collector.Ids
contains a list of node numbers. For results with the location set to elem or elemnode, collector.Ids
contains a list of element numbers.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
67
Extension Capabilities
supported for extensions developed in previous versions of ACT, but the use of the <evaluate>
callback is recommended for new extension development.
As with the loads and results features, the solver definition must be encapsulated within a <simdata>
tag. In this example the context attribute is "Project|Mechanical." When "Project" is specified as a
context attribute, the solver appears as a component in the Workbench Project Schematic (see Figure 37: Project Schematic with External Solver System (p. 69)).
The solver definition begins with the tag <solver>. This tag takes some mandatory attributes:
name: internal name of the solver
version: version of the solver
caption: display name of the solver
68
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Following is the code for the extension (file main.py). The solver code is located in a separate file,
solver.py, which is placed in the same folder as main.py. The third line of the main.py script is
"import solver." This Python technique is using separate code for reuse and maintainability. The script
in solver.py defines the SolverEngine class.
import os
import solver
def CreateValuesLoad(analysis):
analysis.CreateLoadObject("Values")
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
69
Extension Capabilities
initValues = {}
sol = None
solbystep = {}
values = {}
steps = []
res = [0.]
dScal = [0.]
dVec = [0., 0., 0.]
def WriteInitialValues(load,filename):
global initValues
propEx = load.Properties["Expression"]
exp = propEx.Value
if exp=="":
return None
vexp = compile(exp,'','eval')
values = []
propGeo = load.Properties["Geometry"]
refIds = propGeo.Value.Ids
mesh = load.Analysis.MeshData
for refId in refIds:
meshRegion = mesh.MeshRegionById(refId)
nodeIds = meshRegion.NodeIds
for nodeId in nodeIds:
node = mesh.NodeById(nodeId)
x = node.X
y = node.Y
z = node.Z
v = 0.
try:
v = eval(vexp)
v = float(v)
finally:
initValues.Add(nodeId,v)
def NodeValues(load,nodeIds):
propEx = load.Properties["Expression"]
exp = propEx.Value
if exp=="":
return None
try:
vexp = compile(exp,'','eval')
except:
return None
values = []
mesh = load.Analysis.MeshData
for id in nodeIds:
node = mesh.NodeById(id)
x = node.X
y = node.Y
z = node.Z
v = 0.
try:
v = eval(vexp)
v = float(v)
finally:
values.Add(v)
return values
def Solve(s, fct):
global steps
global initValues
global sol
global solbystep
global values
solbystep = {}
solbystepTmp = {}
f = open("solve.out","w")
f.write("SolverEngine version 1.0\n\n\n")
try:
70
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
maxIter = int(s.Properties["MaxIter"].Value)
f.write("Max. iteration : %d\n" % (maxIter))
mesh = s.Analysis.MeshData
numEdges = 0
geo = ExtAPI.DataModel.GeoData
nodeIds = []
for asm in geo.Assemblies:
for part in asm.Parts:
for body in part.Bodies:
for edge in body.Edges:
numEdges = numEdges + 1
ids = mesh.MeshRegionById(edge.Id).NodeIds
nodeIds.extend(ids)
steps = []
stepsTmp = []
f.write("Num. edges : %d\n" % (numEdges))
sol = solver.SolverEngine(mesh,initValues,nodeIds)
initValues = sol.Run(maxIter,f,stepsTmp,solbystepTmp)
nodeIds = mesh.NodeIds
sol = solver.SolverEngine(mesh,initValues,nodeIds)
values = sol.Run(maxIter,f,steps,solbystep)
initValues = {}
except StandardError, e:
f.write("Error:\n");
f.write(e.message+"\n");
f.close()
return False
f.close()
return True
def GetSteps(solver):
global steps
return steps
def Save(folder):
global solbystep
fm = System.Runtime.Serialization.Formatters.Binary.BinaryFormatter()
try:
stream = System.IO.StreamWriter(os.path.join(folder,"sol.res"),False)
except:
return
try:
fm.Serialize(stream.BaseStream,solbystep)
finally:
stream.Close()
def Load(folder):
global solbystep
if folder==None:
return
fm = System.Runtime.Serialization.Formatters.Binary.BinaryFormatter()
try:
stream = System.IO.StreamReader(os.path.join(folder,"sol.res"))
except:
return
try:
solbystep = fm.Deserialize(stream.BaseStream)
finally:
stream.Close()
class ExtSolver1Reader(ICustomResultHeader):
def __init__(self,infos):
self.infos = infos
self.step = 1
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
71
Extension Capabilities
def GetCurrentStep(self):
return self.step
def SetCurrentStep(self,stepInfo):
self.step = stepInfo
def GetStepValues(self):
global steps
return steps
def GetResultNames(self):
return ["VALUES"]
def GetResultLocation(self,resultName):
return ResultLocationEnum.Node
def GetResultType(self,resultName):
return ResultTypeEnum.Scalar
def GetComponentNames(self,resultName):
return [""]
def GetComponentUnit(self,resultName,componentName):
return "Temperature"
def GetValues(self,resultName,collector):
global solbystep
if self.step.Set in solbystep:
values = solbystep[self.step.Set]
for id in collector.Ids:
if id in values:
collector.SetValues(id, [values[id]])
def GetReader(solver):
return ["ExtSolver1Reader"]
The function associated to the <onsolve> callback is Solve. This function creates a file solve.out,
which is read interactively by the application and stored in the solution information.
By default, the application launches the resolution directly into the working directory, so it is not necessary to set the folder in which the solve.out file must be created.
The callback function must return True or False to specify if the solve has succeeded or failed.
Note that it is not possible to return progress information with the current version.
Post Processing
You can create a result reader to expose results.
To do that, you create a class that implements the ICustomResultReader interface. The following
methods need to be implemented. For each method, the expected results that must be returned are
described.
GetCurrentStep(self)
This method must return the current step number.
SetCurrentStep(self,stepInfo)
This method is called each time the current step number is changed.
GetStepValues(self)
This method must return a lost of double values that represents the time steps or frequencies.
72
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
73
Extension Capabilities
Figure 38: Analysis Settings Object Associated to External Solver
74
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
75
Extension Capabilities
Figure 41: Post-processing Associated to External Solver
76
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
As in previous examples, the XML first defines the extension using a version and name attribute. The
path to the Python script file main.py is specified by the <script> tag. The ACT toolbar is defined
in the <interface> tag, which has a context of DesignModeler. The callback function named createMyFeature is used to create and add the geometry to the DesignModeler environment.
The definition of the geometry is encapsulated by the <simdata> begin and end tags. The attributes
in the <geometry> begin tag provide the name, caption, icon, and version that apply to this geometry.
The geometry <callbacks> tag encapsulates two callbacks <ongenerate> and <onaftergenerate>.
The tag <ongenerate> specifies the name of the Python function that is called when the geometry is
generated by the application. The application provides the geometry type (type IDesignModelerGeoFeature) as the callback argument.
This callback must return a Boolean value to indicate whether the generation has been successful; it
returns true if the generation has succeeded and false if it has failed.
The tag <onaftergenerate> specifies the name of the Python function that is called after the geometry
is generated by the application. The application provides the geometry type (type IDesignModelerGeoFeature) as the callback argument.
To specify additional details about the geometry, you can include additional tags, such as <canadd>,
<onadd>, <oninit>, or <onmigragte> between the <callbacks> begin and end tags.
Below the callbacks definition, you can define the properties that will be applied to the actual definition
of the geometry (in this example, Face and Length). These properties are displayed in the Details View
pane of ANSYS DesignModeler, where the user provides the necessary values to complete the geometry
definition. When we review the Python script in a subsequent section, we will see how the geometry
properties can be retrieved and/or modified.
The following figure shows that each property defined above appears in the Details View pane with
the corresponding names and types of interface control.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
77
Extension Capabilities
Figure 42: Feature and Corresponding Properties in the Details View Pane
Note that the two geometry properties, Face and Length, use different control types.
The Face property uses a scoping control type with the attribute of selection_filter set to face.
This specifies that the value for this property will be one or more faces. The faces will be defined in the
main.py file and then used to generate our geometry.
The Length property uses a float control type, and does not require the definition of one specific callback.
Instead, the XML definition introduces a physical quantity dependency with the unit attribute, which
specifies that this property is consistent with a length. The default attribute specifies a default value
of 1.2[m]; this default value is exposed in the Details View pane each time a new load is created.
78
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
79
Extension Capabilities
In our example, the function generateMyFeature is referenced in the GeometryFeature.xml
file by the <ongenerate> callback. When called, it generates the geometry feature. Within this function,
the following details about the geometry are defined:
The length property, which will be used later to create the primitive. The conversion of the length unit
ensures that we are working with the expected metric unit.
The scoped face property, which in this example is three faces.
The bodies list, where we will add all the geometric features to be created.
The builder, which serves as the ACT gateway in DesignModeler. We will access all features and operations
from here.
The faces variable, which will be used as the argument to create our circle. Under faces:
Define the centroid of the scoped face.
Evaluate the normal to this face.
Evaluate the radius that will be used for our arc wire.
Calculate the xdir, which is the principle direction of the arc wire defined below and is required to draw
our arc.
The vectorProduct and scalarProduct objects are used to specify the location of the geometrys
primitives and operations.
The next several objects generate an arc wire.
With the arc_generator object, we use the primitive generator builder.Primitives.Wire.CreateArc. The CreateArc() method uses arguments from faces to draw the circle. This generator can
be used one or more times to build the primitive body.
With the arc_generated object, we use the Generate() method to generate the primitive body.
With the disc_generator object, we use the operations generator builder.Operations.Tools.WireToSheetBody to define a disc based on the circle.
The next several lines extrude the disc into a cylinder.
With the extrude object, we use the operations generator builder.Operations.CreateExtrudeOperation. The CreateExtrudeOperation specifies that the resulting extrusion will be equal to
the value of the Length property.
With cylinder_generator object, we use the ApplyTo method to define the geometry to which
the extrude operation will be applied. The ApplyTo() method returns a list of bodies to which the operation will be applied.
Bodies added to the feature.Bodies list will be added to DesignModeler after the generation. All other
bodies used in the generation process will be lost.
The feature.Bodies list can contain both bodies and parts. We can create a part with the command
builder.Operations.Tools.CreatePart(list_of_bodies).
80
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
81
Extension Capabilities
The feature.Properties[Minimum Volume"].Value entry sets the Minimum Volume
property in DesignModeler to the minimum_volume value.
The ExtAPI.SelectionManager.NewSelection(edges) command creates a new selection
including all the edges previously selected.
The named_selection = ExtAPI.DataModel.FeatureManager.CreateNamedSelection() command creates a named selection which will be defined by the current selection containing
all the edges previously selected.
Figure 44: Feature, Named Selection, and Properties in DesignModeler
82
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
This generic architecture makes it possible to implement a variety of algorithms without needing to
worry about the communication with solvers. Since the external methods are hosted by DX, they also
take advantage of the ANSYS Workbench platform architecture to work with any kind of simulation
project defined in ANSYS Workbench, with no additional implementation effort.
The following topics are discussed:
The Design Exploration Process
Implementing a DX Extension
Notes on Method Class Implementation
Optimization Study
Variables
Variables
DOE domain
Optimization domain
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
83
Extension Capabilities
Design of Experiments
Optimization Study
Parameter relationships
Objectives
Constraints
The Variables are the parameters of the Workbench project. As there are input and output parameters,
there are input and output variables for the sampling or optimization. Note that, since the user can
disable input parameters, the number of input variables transferred to the external functionality is
smaller than or equal to the number of input parameters defined in the Workbench project.
The Domain is the multidimensional space that the sampling or optimizer can explore in order to
generate the DOE or solve the optimization problem. It is defined by the input variables and their range
of variation or as a list of possible values. There are different types of input variables:
Double Variable:
Continuous variable defined by a range of variation, from its lower to its upper bound, where the bounds
are real values
Exposed to the user as a Continuous Input Parameter
Double List Variable:
Defined by a list of sorted real values
Exposed to the user as a Continuous Input Parameter with Manufacturable Values
Integer List Variable:
Defined by a list of integer values
Exposed to the user as a Discrete Input Parameter
The optimization Parameter Relationships define relationships between input variables such as
P1+2*P2 <= 12.5[mm]". They allow the user to restrict the definition of the optimization domain.
The optimization Objectives are defined on variables (e.g., Minimize P3). The following objective types
are supported:
Minimize a variable
Maximize a variable
Seek Target for a variable, where the target is a user-specified constant value
The optimization Constraints are defined on variables, as well (e.g., P3 <= 80). Both an objective and
a constraint can be defined for the same variable. The following constraint types are supported:
Less Than, where the user defines the lower bound (constant value)
Greater Than, where the user defines the upper bound (constant value)
Equal To, where the user defines the target value (constant value)
84
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
The DX Component
DX exposes several types of systems in Workbench, with each system type corresponding to one of its
parametric features such as Parameters Correlation, Response Surface, Six Sigma Analysis, etc. DX
components can be found in the Design Exploration toolbox.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
85
Extension Capabilities
Response Surface Optimization system:
The system is composed of three components (Design of Experiments, Response Surface, and Optimization).
Each point requested by the optimizer is calculated by evaluating the response surface.
With this approach:
The optimizer manipulates approximated output parameter values.
The number of input parameters is limited by the ability to generate the response surface. However,
the cost is extremely low because the resources needed to evaluate the response surface are negligible.
The optimization is performed as a post-processing operation based on the response surface, so several
alternative optimization studies can be performed very quickly on the same surface.
The DX Extension
External DOEs and optimizers can be packaged and installed as Workbench extensions. When the extension is installed and loaded, DX detects the external DOEs or optimizers and exposes them as additional options in the DesignXplorer component. If the user selects one of these custom methods, DX
delegates to the selected external option; it delegates sampling resolution to the external sampling
and optimization resolution to the external optimizer. Note that when an external option is used, the
Workbench session is journaled and can be replayed as usual.
The extension is a container for one or more DOEs or optimizers. The DOEs and optimizers themselves
are generally provided as compiled libraries included in the .wbex extension file.
Implementing a DX Extension
A DX extension has three main parts:
XML file that declares, defines and configures the extension
Python scripts that implement callbacks
ISamplingMethod or IOptimizationMethod implementation, which is the adapter to your existing
implementation. This is typically achieved in C# or IronPython.
This section describes each of these pieces and includes references to several examples of functional
DX extensions.
Implementation Requirements
The implementation of a DX extension requires:
ANSYS Workbench installation
ANSYS Customization Suite license
IronPython, which is provided as part of ANSYS Workbench in the directory <installdir>\commonfiles\IronPython
Microsoft Visual Studio 2010 SP1 for C# implementation
86
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
In Figure 48: Declaration and Definition of an External DOE (p. 87), the DOE defined is called FullFactorial.
The two attributes framed in red are examples of capabilities being defined for this DOE. Here we can
see that for FullFactorial:
The LogFile attribute is set to true, so the sampling has the capability to use the DX API to generate a
log file in the Workbench project.
The CustomTable attribute is set to false, so the DOE does not have the capability to handle the custom
table available in DX.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
87
Extension Capabilities
All other capabilities are configured per the default values. For a listing of capabilities, see DX Extension
Capabilities (p. 89).
The callbacks to hook up with DX are framed in blue. Note that the OnCreate callback, which is invoked
to obtain an ISamplingMethod instance, is mandatory. All other callbacks are optional.
Finally, all of the properties declared for the DOE in Figure 48: Declaration and Definition of an External
DOE (p. 87) are framed in orange. These properties allow the user to control specific settings of the
algorithm, access relevant output information (e.g. number of levels or status), or whatever else the
DOE needs to expose as a result of the sampling run.
Figure 49: Declaration and Definition of an External Optimizer
In Figure 49: Declaration and Definition of an External Optimizer (p. 88), the extension is named MyOptimizer and defines two different external optimizers. The declaration for each optimizer is marked with
a green bracket. Each optimizer will be managed by DX as an independent optimization method.
In Figure 49: Declaration and Definition of an External Optimizer (p. 88), the first optimizer defined is
called MyOptimizer. The two attributes framed in red are examples of capabilities being defined for
this optimizer. Here we can see that for MyOptimizer:
88
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
DX Extension Capabilities
A DX extension is designed to solve a specific range of problems, and its implementation is characterized
by complementary features and limitations. To allow DX to determine when a given sampling or optimization method is applicable, depending on the current DOE or optimizer definition, it is necessary to
declare the main capabilities of each external method. There are also optional capabilities used by DX
to adjust the user interface according to what complementary features are supported by the external
method.
For external DOEs, the capabilities are specified in the XML file as attributes of the <sampling> element.
For external optimizers, the capabilities are specified in the XML file as attributes of the <optimizer>
element.
Main Capabilities
The main capabilities are used to determine if the external sampling or optimization method can be
applied to the problem as it is currently defined. If the external method has the required capabilities,
it is available as a menu option in the DX Properties view (applicable external samplings are available
in the Design of Experiments Type menu, and applicable optimizers are available in the Method Name
menu). If an external method is not applicable, it is not listed as a menu option. Each modification to
the DOE or optimization study (e.g. modifying an existing input parameter, enabling or disabling an
input parameter, etc.) triggers an evaluation of the relevant capabilities to reassess whether the external
method is applicable and will be made available to the user.
DOE Example
The external sampling FullFactorial, defined previously in Figure 48: Declaration and Definition of an External DOE (p. 87), has MaximumNumberOfInputParameters capability equal to 10. As a consequence,
as soon as the user defines more than 10 input parameters, FullFactorial is removed from the list of
available sampling methods. If the user then changes the DOE study so that the number of input parameters
is less than or equal to 10, FullFactorial is immediately restored as an available option.
Note that if the user selects FullFactorial first and defines more than 10 input parameters afterward,
the sampling method is retained. Given the incompatibility of the sampling method and the number
of input parameters, however, the state of the DOE will turn to Edit Required and a Quick Help
message will be provided to explain why the sampling cannot be launched as currently configured.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
89
Extension Capabilities
Optimization Example
The external optimizer MyFirstOptimizer, defined previously in Figure 49: Declaration and Definition of
an External Optimizer (p. 88), does not have the SeekObjective capability. As a consequence, as soon
as the user defines a Seek Target objective, MyFirstOptimizer is removed from the list of available optimization methods. If the user then changes the optimization study so that the Seek Target objective is no
longer defined, MyFirstOptimizer is immediately restored as an available option.
Note that if the user selects MyFirstOptimizer first and defines the unsupported Seek Target objective afterward, the optimization method is retained. Given the incompatibility of the optimization
method and the objective, however, the state of the Optimization will turn to Edit Required and
a Quick Help message will be provided to explain why the optimization cannot be launched as
currently configured.
The table below notes the main capabilities controlling the availability of external methods.
DOE
Optimizer
MaximumNumberOfInputParameters
MaximumNumberOfInputParameters
MaximumNumberOfDoubleParameters
MaximumNumberOfDoubleParameters
MaximumNumberOfDoubleListParameters
MaximumNumberOfDoubleListParameters
MaximumNumberOfIntegerListParameters
MaximumNumberOfIntegerListParameters
ParameterRelationship
ObjectiveOnInputParameter
ConstraintOnInputParameter
MinimizeObjective
MaximizeObjective
SeekObjective
LessThanConstraint
GreaterThanConstraint
EqualToConstraint
InsideBoundsConstraint
MinimumNumberOfObjectives
MaximumNumberOfObjectives
MinimumNumberOfConstraints
MaximumNumberOfConstraints
BasedOnResponseSurfaceOnly
90
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Optional Capabilities
The optional capabilities are used to enable or disable specific options or features of DX according to
the level of support provided by the selected external method. After the main capabilities have established that a method is applicable to a given DOE or optimization study, the optional capabilities determine which features will be exposed for that method in the DX user interface.
For example, the LogFile capability is declared for the sampling defined in Figure 48: Declaration and
Definition of an External DOE (p. 87), FullFactorial, and also for the optimizer defined in Figure 49: Declaration and Definition of an External Optimizer (p. 88), MyFirstOptimizer. As a result, the corresponding
features to manage and expose the log file are enabled in DX and exposed in the user interface. If this
capability was not declared or was set to false, DX would adjust its user interface to hide the access
to the log file because it is not supported by this external method.
As additional examples:
If the selected sampling does not support the Custom Table capability, the Custom Table is not available
in the user interface.
If the selected optimizer does not support the Maximize objective type, then the objective types available
in the user interface are limited to Minimize and Seek Target.
If the optimizer does not support importance levels on objectives, the Objective Importance property is
not available in the Property view of the optimization criterion.
For a comprehensive list of capabilities, see the "Sampling" and Optimizer" sections in the ANSYS ACT
API Reference Guide and ANSYS ACT XML Reference Guide.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
91
Extension Capabilities
Notes on Monitoring
Notes on Sampling Monitoring
DX provides user interface elements that allow the user to monitor the progress of a sampling, in addition
to the progress and log messages.
Notes on Results
Notes on Sampling Results
The DOE post-processing is similar for all DOE methods. It is based on results data rendered graphically
and/or as tables in the user interface.
Once the DOE is generated, DX extracts all results provided by the sampling in order to generate postprocessing tables and charts:
Sample points from the ISamplingMethod.Samples property
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
93
Extension Capabilities
Figure 50: End-to-End Mesh Transfer Between Mesh, Mesher, and Fluent Setup
ACT does not observe schematic activities until at least one extension provides one callback for a
schematic action. At that time, ACT starts observing the requested schematic action and invokes your
callback. Most of the schematic callbacks receive a user task as an argument. (For details, see the ACT
API documentation.)
94
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Stopping Observations:
When you unload all extensions that register schematic callbacks, ACT will cease observing schematic actions.
This sets Workbench back to its prior state and can be used as a fix if schematic observations cause unexpected behavior.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
95
Extension Capabilities
If you have defined custom taskgroups or tasks, the custom taskgroup(s) will be exposed as systems in a
new Workbench Toolbar group, as shown below:
Figure 51: Custom Taskgroups in the Workbench Toolbox
These custom taskgroups can be added to the Project Schematic. When you invoke an Update on
a custom task within the taskgroup, the extension may:
Obtain the inputs.
Prepare the inputs.
Write input file(s).
Run the external solver or performs calculations.
Read output file(s).
Set the parameters or properties to the calculated values.
96
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
97
Extension Capabilities
<onaftertaskduplicate></onaftertaskduplicate>
<onbeforetasksourceschanged></onbeforetasksourceschanged>
<onaftertasksourceschanged></onaftertasksourceschanged>
<onbeforetaskcreation></onbeforetaskcreation>
<onaftertaskcreation></onaftertaskcreation>
<onbeforetaskdeletion></onbeforetaskdeletion>
<onaftertaskdeletion></onaftertaskdeletion>
<onbeforetaskcanusetransfer></onbeforetaskcanusetransfer>
<onaftertaskcanusetransfer></onaftertaskcanusetransfer>
<onbeforetaskcanduplicate></onbeforetaskcanduplicate>
<onaftertaskcanduplicate></onaftertaskcanduplicate>
<onbeforetaskstatus></onbeforetaskstatus>
<onaftertaskstatus></onaftertaskstatus>
<onbeforetaskpropertyretrieval></onbeforetaskpropertyretrieval>
<onaftertaskpropertyretrieval></onaftertaskpropertyretrieval>
</callbacks>
<tasks>
<task name="" caption="" icon="" version="1">
<callbacks>
<onupdate></onupdate>
<onrefresh></onrefresh>
<oninitialize></oninitialize>
<onedit></onedit>
<onreset></onreset>
<onstatus></onstatus>
<onreport></onreport>
</callbacks>
<contextmenus>
<entry name="" caption="" icon="" priority="" type="">
<callbacks>
<onclick></onclick>
</callbacks>
</entry>
</contextmenus>
<propertygroup name="" caption="">
<property name="" caption="" control="" default="" readonly=""
needupdate="" visible=""
persistent="" isparameter="" keytype="" valuetype="" elementtype=""/>
</propertygroup>
<property name="" caption="" control="" default="" readonly=""
needupdate="" visible=""
persistent="" isparameter="" keytype="" valuetype="" elementtype=""/>
<parameters>
<parameter name="" caption="" usage="" control="" version="1"/>
</parameters>
<inputs>
<input/>
<input type="" format=""/>
</inputs>
<outputs>
<output type="" format=""/>
</outputs>
<rsmjob name="" deletefiles="" version="1">
<inputfile id="1" name=""/>
<outputfile id="1" name=""/>
<program>
<platform name="" path=""/>
<argument name="" value="" separator=""/>
</program>
<callbacks>
<oncreatejobinput></oncreatejobinput>
<onjobstatus></onjobstatus>
<onjobcancellation></onjobcancellation>
<onjobreconnect></onjobreconnect>
</callbacks>
</rsmjob>
</task>
</tasks>
<taskgroups>
<taskgroup name="" caption="" icon="" category="" abbreviation="" version="1"
isparametricgroup="False">
<includetask name="" external=""/>
98
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
99
Extension Capabilities
The onAfterUpdate method is filtered; it will produce different messages for Engineering Data tasks
and the second Setup task, while printing ignored for all other tasks.
Note
The Setup tasks for multiple Fluent taskgroups would be identified in the following sequence: Setup, Setup 1, Setup 2, etc.
The onBeforeDuplicate method is filtered; it will print a specific message for the Setup tasks for all
Fluent tasks on the schematic.
...
def onBeforeUpdate(task):
msg = getPrintMessage('pre-update', task)
print msg
def onAfterUpdate(task):
if task.Name == "Engineering Data":
msg = getPrintMessage('post-update', task)
print msg
elif task.Name == "Setup 2":
print("fluent setup 2")
else:
print("ignored")
def onBeforeDuplicate(task):
if task.Container.Type == "Ansys.Fluent.Addin:SetupContainer":
print("all fluent setups")
else:
print("ignored")
...
ACT will execute the callbacks from lowest order to hightest order (i.e., a callback with an order of 2
will execute after a callback with an of order 1). When values are identical, the order in which the
extension was loaded (the callback was processed) will dictate the collision resolution.
Note
Hyphenation within the table entries can be ignored; assume that callbacks and methods
do not inlcude hyphens.
100
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Methods
Arguments
<onbeforetaskreset>
onBeforeReset
task
<onaftertaskreset>
onAfterReset
Refresh
Consumes all upstream data and prepares any local data for an ensuing update.
Global Callbacks
Methods
Arguments
<onbeforetaskrefresh>
onBeforeRefresh
task
<onaftertaskrefresh>
onAfterRefresh
Update
Generates all broadcast output types that render the component fully solved.
Global Callbacks
Methods
Arguments
<onbeforetaskupdate>
onBeforeUpdate
task
<onaftertaskupdate>
onAfterUpdate
Create
Creates a task based on an underlying template.
Global Callbacks
Methods
Arguments
<onbeforetaskcreate>
onBeforeCreate
templateTask
Note:This is a task
representing the
template. Some
components do not
include the template as a
command parameter to
the create command.
As a result, this could be
null in some situations.
<onaftertaskcreate>
onAfterCreate
task
Delete
Removes a task from a task group.
Global Callbacks
Methods
Arguments
<onbeforetaskdelete>
onBeforeDelete
task
<onaftertaskdelete>
onAfterDelete
Duplicate
Creates an identical, yet independent, clone of the task.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
101
Extension Capabilities
Global Callbacks
Methods
Arguments
<onbeforetaskduplicate>
onBeforeDuplicate
task
<onaftertaskduplicate>
onAfterDuplicate
SourcesChanged
Processes a change in upstream sources.
Global Callbacks
Methods
Arguments
<onbeforetasksourceschanged>
onBeforeSourcesChanged
task
<onaftertasksourceschanged>
onAfterSourcesChanged
CanUseTransfer
Checks whether the task can consume data from a specific upstream task.
Callback receives two tasks as arguments: the source (upstream producer) task and target
(downstream consumer) task.
Global Callbacks
Methods
Arguments
<onbeforetaskcanusertransfer>
onBeforeCanUseTransfer
sourceTask, targetTask
<onaftertaskcanusertransfer>
onAfterCanUseTransfer
sourceTask, targetTask,
systemCalculatedCanUse
Note: systemCalculatedCanUse argument provides
the result that the original
task determined. The return
value of this callback
(boolean) will alter the
originally calculated value.
CanDuplicate
Checks whether the task permits duplication.
Callback receives no arguments. The schematic does not provide any workable information to
construct or provide tasks (either container-based or template-based). Callback will only serve as a
general processing hook, if exposed.
Global Callbacks
Methods
Arguments
<onbeforetaskcanduplicate>
onBeforeCanDuplicate
None
<onaftertaskcanduplicate>
onAfterCanDuplicate
systemCalculatedCanUse
Note: systemCalculatedCanDuplicate argument
provides the result that the
original task determined. The
return value of this callback
102
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Methods
Arguments
(boolean) will alter the
originally calculated value.
Status
Calculates the tasks current state.
Global Callbacks
Methods
Arguments
<onbeforetaskstatus>
onBeforeStatus
task
<onaftertaskstatus>
onAfterStatus
task, systemCalculatedStatus
Note: systemCalculatedStatus argument provides
the result that the original
task determined. The return
value of this callback
component state will alter
the originally calculated
value.
PropertyRetrieval
Determines the visibility of property-containing objects.
Global Callbacks
Methods
Arguments
<onbeforetaskpropertyretrieval>
onBeforePropertyRetrieval
task
<onaftertaskpropertyretrieval>
onAfterPropertyRetrieval
task, systemCalculatedPropertyObject
Note: systemCalculatedPropertyObjects
argument provides the
result that the original task
determined. The return
value of the callback (list of
data references) will alter
the originally calculated
value.
Defining a Task
One or more custom tasks can be defined in the <tasks> node. Individual tasks are defined in a
<task> child node. The base <task> class represents an extension-based workflow task which serves
a template role from which ACT will create real instances.
In each task definition, you must include the name and version attributes. Child nodes can be used
to specify callbacks, inputs and outputs, properties, parameters, context menus, and remote execution.
The basic structure of a task definition is shown below:
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
103
Extension Capabilities
<tasks>
<task name="" caption="" icon="" version="1" enableGenericTransfer="">
<callbacks>
<IsVisible></IsVisible>
<IsValid></IsValid>
<GetValue></GetValue>
<SetValue></SetValue>
<OnShow></OnShow>
<OnHide></OnHide>
<OnInit></OnInit>
<OnAdd></OnAdd>
<OnRemove></OnRemove>
<OnDuplicate></OnDuplicate>
<OnActivate></OnActivate>
<OnCancel></OnCancel>
<OnApply></OnApply>
<Value2String></Value2String>
<String2Value></String2Value>
<OnValidate></OnValidate>
<OnMigrate></OnMigrate>
</callbacks>
<contextmenus>
<entry name="" caption="" icon="" priority="" type="">
<callbacks>
<onclick></onclick>
</callbacks>
</entry>
</contextmenus>
<propertygroup name="" caption="">
<property name="" caption="" control="" default="" options="" readonly="" needupdate="" visible=""
persistent="" isparameter="" keytype="" valuetype="" elementtype=""/>
</propertygroup>
<property name="" caption="" control="" default="" readonly="" needupdate="" visible=""
persistent="" isparameter="" keytype="" valuetype="" elementtype="">
<callbacks>
<IsVisible></IsVisible>
<IsValid></IsValid>
<GetValue></GetValue>
<SetValue></SetValue>
<OnShow></OnShow>
<OnHide></OnHide>
<OnInit></OnInit>
<OnAdd></OnAdd>
<OnRemove></OnRemove>
<OnDuplicate></OnDuplicate>
<OnActivate></OnActivate>
<OnCancel></OnCancel>
<OnApply></OnApply>
<Value2String></Value2String>
<String2Value></String2Value>
<OnValidate></OnValidate>
<OnMigrate></OnMigrate>
</callbacks>
<property/>
<parameters>
<parameter name="" caption="" usage="" control="" version="1"/>
</parameters>
<inputs>
<input/>
<input type="" count="" format=""/>
</inputs>
<outputs>
<output type="" format=""/>
</outputs>
<rsmjob name="" deletefiles="" version="1">
<inputfile id="1" name=""/>
<outputfile id="1" name=""/>
<program>
<platform name="" path=""/>
<argument name="" value="" separator=""/>
</program>
<callbacks>
104
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Once a general transfer-enabled task exists in the schematic, the transfer data can be accessed in order
to push and pull data within the data store. A simple TransferData property is exposed off of the
task argument of all task callbacks or tasks retrieved from ExtAPI or as a callback argument:
def producer_update(task):
data = task.TransferData
Once obtained, the TransferData dictionary acts like any other dictionary within ACT. You can both
set and retrieve values through string keys, and can perform other collection-based calls such as
Add() and Remove(). The custom IDictionary is coded in such a way that if you try to access a
non-existent key (e.g., to set a new value), it will automatically add the key and allow the set to take
place.
task.TransferData["Test"] = Sample text
One the consumer side, you can easily access the transfer data, as follows:
def consumer_update(task):
container = task.InternalObject
upstreamData = container.GetInputDataByType(
InputType="GeneralTransfer")
for upstreamDataEntity in upstreamData:
task = ACT.GetTaskForContainer(
upstreamDataEntity.Container)
data = task.TransferData["Test"]
The transfer data approach eliminates dependency on file and file path transfers. However, you can still
opt to pass file paths via the new transfer data, if desired; no further actions or implementations are
required to fulfill the basic framework transfer connections.
Note
Downstream processing may require additional actions implemented via ACT workflow callbacks.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
105
Extension Capabilities
In some circumstances, you may want to interrogate a tasks source tasks. For example, this can ease
the access of transfer data from upstream sources. The SourceTasks property is now available on all
UserTask objects:
def myTaskUpdate(task):
sources = task.SourceTasks
for sourceTask in sources:
data = sourceTask.TransferData[Test]
Tasks can filter or block their source connections by implementing a task-level canconsumedata
callback:
XML:
<task name="Consumer"...>
<callbacks>
<canconsumedata>taskCanUse</canconsumedata>
...
</callbacks>
...
</task>
IronPython:
def taskCanUse(task, sourceTask):
if sourceTask.Name == Foo:
return True
else:
return False
Argument(s)
oninitialize
task
onupdate
task
onrefresh
task
onreset
task
onedit*
task
onstatus
task
onreport
task, report
ondelete
task
canconsumedata
sourceTask, targetTask
*Definition of the <onedit> callback automatically creates a default Edit context menu for the task.
In the event of task-level callback errors, exceptions are provided to the Workbench framework, allowing
the framework to detect failures and correctly manage task states. Exception details are also reported
to the Log.
106
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
107
Extension Capabilities
object
quantity
option/select
fileopen
folderopen
list
dictionary
DataContainerReference
IronPython:
def stringVisibilityCheck(entity, property):
inputVal = entity.Properties["Input"]
if inputVal.Value == 2.0:
return True
else:
return False
108
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
IsValid
Users can define the isvalid callback on task-exposed properties. This callback can dynamically control
whether or not a property is valid. Users can key off of any desired condition or other task property to determine the property's validity, returning True or False as a result.
XML:
...
<task ...>
...
<property name="Input" caption="Input" control="double"
default="0.0" readonly="False" needupdate="True"
visible="True" persistent="True"
isparameter="True">
<callbacks>
<isvalid>validityCheck</isvalid>
</callbacks>
</property>
...
</task>
...
IronPython:
def validityCheck(entity, property):
if property.Value == 1.0:
return False
else:
return True
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
109
Extension Capabilities
Figure 52: Valid Property
GetValue
Users can define the getvalue callback that is called when the user obtains a value either from command
line/script or through the project itself.
SetValue
Users can define the setvalue callback that is called when the user sets a value from either command
line/script or through the project itself.
110
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
111
Extension Capabilities
Access is available at the master ExtAPI level. Assuming that only one task resides in the schematic:
task = ExtAPI.DataModel.Tasks[0]
propA = task.Properties[PropertyA].Value
task.Properties[PropertyA].Value = Foo
When you must perform advanced schematic interactions, you can access task.InternalObject
to receive the tasks underlying DataContainerReference. This may be needed to execute Workbench-specific scripting commands (see the Workbench Journaling and Scripting Guide for more details):
task = ExtAPI.DataModel.Tasks[0]
container = task.InternalObject
container.SendCommand(Language=Python, Command=print test)
Interaction with pre-installed tasks operates in the same way. For example, if you create a Fluent analysis system in the schematic, you could set the Run In Parallel property as follows:
task = ExtAPI.DataModel.Task[0]
task.Properties[RunParallel].Value = True
All set-based actions performed via the Property.Value calls are recorded in the journal. Using
the last example with a Fluent system, the resulting journal would contain the following code:
# encoding: utf-8
# Release 17.1
SetScriptVersion(Version=17.1.21)
Reset()
template1 = GetTemplate(TemplateName=FLUENT)
system1 = template1.CreateSystem()
setup1 = system1.GetFluentLauncherSettings()
fluentLauncherSettings1.RunParallel = True
IronPython:
def update(task):
filePath = task.Properties["Prop1"].Value
dirPath = task.Properties["Prop2"].Value
112
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
For option-based task properties, specify the standard select control type and use the options attribute to provide the items to be populated to the control.
...
<task ...>
...
<property name="ComboBoxTest" caption="My Prop" control="select"...>
...
<attributes options=one,two,three .../>
...
</task>
...
113
Extension Capabilities
<parameters>
<parameter name="" caption="" usage="" control="" version="1"/>
</parameters>
114
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
For a list of supported transfer types and their corresponding transfer properties, see Appendix C (p. 389).
For a list of the data types and data transfer formats for each addin, see Appendix D (p. 395).
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
115
Extension Capabilities
</task>
...
For a more detailed discussion of how to access RSM capabilities, see the example Custom, Lightweight,
External Application Integration with Custom Data and Remote Job Execution (p. 217).
Defining a Taskgroup
The sole purpose of a taskgroup is to collect tasks. One or more taskgroups can be defined in the
<taskgroups> node. Individual taskgroups are defined in a <taskgroup> child node.
At minimum, each taskgroup definition must include the taskgroup name and version attributes. The
<includetask> and <includeGroup> child nodes are to specify one or more tasks or nested
taskgroups to be included.
In the <includetask> child node, you can reference both the custom tasks defined in your extension
and external" tasks (Workbench-defined components). The optional external attribute, when set to
true, indicates that the referenced task is defined externally (originates from outside the extension).
For an external task, the name attribute must be set to the internally defined template name for the
given component; optionally, you can set the caption attribute to use your own display text. For a listing
of internally defined systems with their components and component display names, see Appendix B (p. 373). To review examples of taskgroups referencing external tasks, see Generic Material
Transfer (p. 225) or Generic Mesh Transfer (p. 229).
If you define a caption, it overrides the task-level caption. Otherwise, the taskgroup-level caption is
used.
The basic structure of a taskgroup definition is shown below:
...
<taskgroups>
<taskgroup name="" caption="" icon="" category="" abbreviation="" version="1"
isparametricgroup="False">
<includetask name="" external=""/>
<includeGroup name=""/>
</taskgroup>
</taskgroups>
...
Note
At present, ACT-defined tasks cannot be added to installed taskgroups. Also, nested taskgroups
within a taskgroup are not recognized by Workbench at 17.1.
116
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Convenience APIs
Convenience APIs are IronPython queries that provide simple access to task-stored input and output
data. The available convenience APIs are:
GetInputDataByType
Returns a List<object> containing upstream data for a given type. For example:
upstreamData =
container.GetInputDataByType(InputType="MeshingMesh")
meshFileRef = None
upstreamDataCount = upstreamData.Count
if upstreamDataCount > 0:
meshFileRef = upstreamData[0]
GetOutputData
Returns a Dictionary<string, List<DataReference>> holding the task's output types. For
example:
outputRefs = container.GetOutputData()
meshOutputSet = outputRefs["SimulationGeneratedMesh"]
meshOutput = meshOutputSet[0]
meshOutput.TransferFile = meshFileRef
GetCustomEntity
Obtains the custom data entity from a container based on the entity's name and type. If the name and
type are not specified, the default ACT object is returned. This object contains the properties defined by
the workflow task from the <propertygroup> and <property> blocks.
entity = ACT.GetCustomEntity(container)
GetCustomEntityPropertyValue
This query returns the value of a property defined on a custom data entity.
inputValue = ACT.GetCustomEntityPropertyValue(entity, "Input")
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
117
Extension Capabilities
SetCustomEntityPropertyValue
This command handles the setting of a custom entity's property value.
ACT.SetCustomEntityPropertyValue(entity, "Output", outputValue)
As in previous examples, the XML file first defines the extension using a version and name attribute.
The path to the Python script file main.py is specified by the <script> tag.
The definition of the load is encapsulated by the <simdata> begin and end tags. The context attribute
for <simdata> has been set to Study , which makes the extension compatible with AIM. The attributes
in the <load> begin tag provide the name, version, caption, icon, support status, and color that apply
to this load. The color attribute is defined in a hexadecimal format. This color is used to contrast the
118
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
The main.py Python file defines the writeNodeId function, which writes the value of the Expression
property on the geometry nodes scoped for the load.
The following figure shows that the CustomPressure ACT load weve created is now made available
to be added as a boundary condition in AIM.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
119
Extension Capabilities
Figure 54: CustomPressure Load Available as a Boundary Condition in AIM
The following figure shows the status of the load once all the properties are defined.
Figure 55: CustomPressure Load with Properties Defined
120
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
121
Extension Capabilities
The XML file has the standard ACT construction, with the version and name attributes defining the
extension, the <script> tag specifying Python main.py script file, and the interface tag defining
the context as Study.
As in the AIM preprocessing example, the definition of the load is encapsulated by the <simdata>
begin and end tags, the <simdata> context attribute has been set to Study, and the attributes in
the <load> begin tag provide the name, version, caption, icon, support status, and color that apply
to the load that will contain the boundary condition. (In this example, our load name and caption are
both InOut.) As before, the <callbacks> tag encapsulates the callback <getsolvecommands>,
which creates the boundary conditions for the load.
Below the callbacks section, the load properties to be used for the boundary conditions are defined:
Inlet, Outlet, Inlet Velocity, Velocity, Outlet Pressure, and Pressure. The control
type,unit, and default tags function as described in previous examples. These properties are displayed in the specific ACT object created by the where the user provides the necessary values to complete
the load definition.
Note
In future releases, the IronPython commands used to define fluid dynamics features
may be modified to ensure consistency with AIM Journaling and Scripting functionality.
For the information on whether a given command has been modified or deprecated,
refer to the ANSYS ACT API Reference Guide.
import clr
clr.AddReference("Ansys.Study.Proxies.Customization")
from Ansys.Study.Proxies.Customization.Analysis import AFDObject
def getcmds(load,stream):
velocity = load.Properties["InletVelocity"]
pressure = load.Properties["OutletPressure"]
faces = []
faces += load.Properties["Inlet"].Value.Ids
faces += load.Properties["Outlet"].Value.Ids
geo = load.Analysis.GeoData
wallFaces = []
for part in geo.Assemblies[0].Parts:
for body in part.Bodies:
for face in body.Faces:
if not faces.Contains(face.Id) and not wallFaces.Contains(face.Id):
wallFaces.Add(face.Id)
boundary = AFDObject.CreateBoundary()
boundary.SetProperty("BoundaryType","Inlet")
boundary.SetProperty("Location",load.Properties["Inlet"].Value.Ids)
boundary.SetProperty("Flow.Option","Velocity")
boundary.SetProperty("Flow.Velocity.Magnitude",velocity.Value.ToString()+' ['+velocity.UnitString+']')
boundary.Send(stream)
boundary = AFDObject.CreateBoundary()
boundary.SetProperty("BoundaryType","Outlet")
boundary.SetProperty("Location",load.Properties["Outlet"].Value.Ids)
boundary.SetProperty("Flow.Option","Pressure")
boundary.SetProperty("Flow.Pressure.GaugeStaticPressure",pressure.Value.ToString()+'
['+pressure.UnitString+']')
122
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
The function getcmds is defined in the main.py Python file for the AFDLoad extension. This function
writes commands to the solver input file. The required input arguments are load and stream, where
load is the load object and stream refers to the solver input file. In our example, the function
getcmds is referenced in the AFDLoad.xml file by the <getsolvecommands> callback. When
called, it creates the boundaries for the AFD object, defines boundary properties, and specifies the
face(s) to which the boundary will be applied. Within this function:
The CreateBoundary() method is applied to AFDObject to create a boundary. (This AFD object was
imported by the import command at the top of the Python file.)
boundary = AFDObject.CreateBoundary()
With boundary.SetProperty, we can also specify the location (faces, bodies, etc.) to which the
boundary will be applied. To do so, we can use the scoping properties previously defined in the extension.
The location property expects a list of identifiers.
boundary.SetProperty("Location",load.Properties["Inlet"].Value.Ids)
To the property that just created, we can add an option representing a velocity (for an inlet) or a pressure
(for an outlet).
boundary.SetProperty("Flow.Option","Velocity")
To the option just added, we add a float value. (This float value could come from a property defined in the
XML file.) We also have the ability to specify a unit.
boundary.SetProperty("Flow.Velocity.Magnitude",velocity.Value.ToString()+' ['+velocity.UnitString+']')
The following figure shows that the InOut ACT load we've created is now made available to be added
as a fluids boundary condition in AIM. This load includes all the properties defined in the extension.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
123
Extension Capabilities
Figure 56: InOut Load Available as a Fluids Boundary Condition in AIM
The following figure shows the status of the load once all the properties are defined.
Figure 57: InOut Load with Properties Defined
124
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Types of Wizards
You can use ACT to create three different types of wizards: Project Wizards (p. 125), Application-Based
Wizards (p. 125), and Mixed Wizard (p. 126).
Project Wizards
A project wizard is executed from the Project tab.
When launched from the Project tab in Workbench, a project wizard can engage any data-integrated
application with Workbench journaling and scripting capabilities (such as DesignXplorer, SpaceClaim,
Mechanical) and incorporate them into the project workflow.
When launched from the Project tab in AIM, a project wizard can be used to automate an AIM simulation.
Application-Based Wizards
An application-based wizard is executed wholly in a specified ANSYS application which provides both
scripting capabilities and ACT support (Mechanical, SpaceClaim, DesignModeler, Electronics Desktop,
Fluent, Fluent Meshing, and AIM). It utilizes the functionality provided by the target application and
provides simulation guidance within the applications workflow.
Application-based wizards executed in AIM are called custom templates and are exposed in AIM under
Simulation Process Templates. When launched, a custom template automatically sets up a simulation
process, defining a custom data panel with custom properties to drive your simulation. The ability to
create both single-step and multiple-step templates is available.
Wizards for some applications, such as native applications like Mechanical or DesignModeler, are run
only within the Workbench environment. Wizards for some other applications (such as those for
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
125
Launched in Workbench
Environment
AIM
SpaceClaim
DesignModeler
Mechanical
Electronics
Desktop
Fluent (Beta)
Mixed Wizard
A mixed wizard is launched from the ANSYS Workbench Project tab and then engages one or more
supported ANSYS applications in order to automate the entire simulation process. A mixed wizard is
used when interactive selection on the model is required at a given step in one given application; it
provides native workflow guidance in both the Project tab and the included applications.
Creating Wizards
As with any extension, you must have an ACT license to create a wizard. (Once a scripted wizard is
complete and the binary version has been created, however, no license is needed to execute it.)
To start creating wizards, you can download templates from the ANSYS ACT Application Store on the
ANSYS Customer Portal.
The following topics are addressed:
Parts of a Wizard
XML Extension Definition File
IronPython Script
Custom Help for Wizards
Customizing the Layout of a Wizard
Parts of a Wizard
ACT wizards include the following files:
XML extension definition file and referenced IronPython script (required)
These files are the same as required for a standard ACT extension and use the same XML and IronPython syntax. Specific elements have to be used in the XML file to define the wizard. To create a wizard,
you can simply begin with an existing extension and modify it. For details on syntax, see the ANSYS
ACT XML Reference Guide and the ANSYS ACT API Reference Guide.
Custom help files (optional)
126
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Creating Wizards
HTML files containing text, images, charts, or other control types can be used to provide instructions
or details for the wizard.
Note
The XML definition syntax is the same for all project wizards, regardless of whether they are
run from the Workbench or the AIM Project tab.
Below is our XML extension file, WizardDemos.xml.
<extension version="2" minorversion="1" name="WizardDemos">
<guid>6D33EFFC-C521-4859-8273-BA320044B6B8</guid>
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
127
128
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Creating Wizards
</property>
<property name="dialog2" caption="DialogProgress" control="text">
<callbacks>
<onvalidate>ValidateDialogProgress</onvalidate>
</callbacks>
</property>
</step>
<step name="ReportView" caption="ReportView" version="1" context="Project"
layout="ReportView@WizardDemos">
<description>Simple example to demonstrate how report can be displayed.</description>
<callbacks>
<onrefresh>RefreshReport</refresh>
</callbacks>
</step>
<step name="CustomStep" caption="CustomStep" enabled="true" version="1" context="Project"
layout="MyLayout@WizardDemos">
<description>Create a mechanical component.</description>
<callbacks>
<onrefresh>RefreshMechanical</refresh>
</callbacks>
<property name="name" caption="System name" control="text" />
</step>
</wizard>
</extension>
Extension definition:
The standard extension definition is the same. The name, version, and IronPython script reference are
unchanged. In our wizard example, the interface context is set to Project because the extension will
be run on the Workbench Project tab.
Wizard definition:
The required name, version, and context attributes are defined. In our example, the context is set
to Project because the wizard will be executed from the Workbench Project tab.
The optional icon and description attributes are also defined. Icon files are stored in the images
folder in the extension directory.
Child nodes define the wizard steps.
Note
For a mixed wizard, the <wizard> context would still be set to Project because the
wizard will be launched from the Project tab. Each step in a mixed wizard would have its
context set to the application in which the step will be executedeither DesignModeler
or Mechanical.
For an AIM custom template, the context attribute is not used for step definitions.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
129
Note
For each step in a mixed wizard, the context would be set to the application in which
the step will be executedeither DesignModeler or Mechanical.
Optional attributes are defined for various steps. For example, the helpFile attribute indicates
the file containing custom help content to be shown in the UI.
Child nodes define callbacks and properties.
Callback definitions:
Callbacks execute an action that has been defined in the IronPython script for the wizard. Each callback
receives the current step as a method argument.
The required <onupdate> callback is invoked when you click the Next button for a Workbench wizard.
In our wizard example, it executes the actions CreateGeometry, CreateMechanical, and CreateFluent.
The <onrefresh> callback is invoked when the next step is initialized. It initiates changes to the interface, so you can use this callback to change the appearance of the wizard, initialize a value to be used
in the current step, instantiate variables, access data of an existing project, etc. In our wizard example,
the <onrefresh> callback executes the RefreshReport and RefreshMechanical actions.
The <onreset> callback resets the state of the step. In our example, it executes the DeleteGeometry
and DeleteMechanical actions.
Note
For an AIM custom template, only the <onupdate> and <onreset> callbacks are
supported.
The <onupdate> callback is invoked when you click the Create Simulation Process
button. Typically, it is used to insert the content of an existing journal into the wizard
to create a workflow and establish boundary conditions, mesh, and solver options.
The <onreset> callback is used to reset situations where the wizard has not been
completed correctly; it allows you to go back to the process properties and modify
them.
Property definitions:
Properties, property groups, and property visibility controls are defined with the same syntax as for a
standard extension property.
The required name , caption , and control attributes are defined for all the properties. The
control attribute specifies the control type for the property. The standard select, float, integer, scoping, text, and fileopen property types are supported. Advanced types such as
applycancel and custom are also supported.
130
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Creating Wizards
Optional attributes are also defined for various properties.
The unit attribute specifies the units for the property value.
The readonly attribute specifies whether the property value is editable.
The default attribute specifies the default property value.
The visibleon attribute controls the visibility of the property. In our example, it is used to
control the display of conditional options in a property group.
The <propertygroup> node is used to create groupings of properties. In our example:
For the first property group, no control is defined, so the group is a list of individual properties
inside the <propertygroup> tags.
The second property group is embedded within the first.
In our example, the control attribute set to select , which provides a drop-down list.
The attributes options tag defines the available options.
The visibleon attribute defines the properties in the group are defined as conditional based
on selection from the drop-down.
The <onvalidate> property callback is used to validate the value entered for a property.
The <propertytable> node is used to create a table for the entry of property values in tabular
format. The Temperature and Pressure properties nested inside the <propertytable> tags
create columns for data entry.
IronPython Script
The IronPython script is referenced by the XML extension definition file. It defines the functions that
will be used by the extension and also the actions that will be performed during each step of the wizard.
ANSYS journaling and scripting commands can be used inside the callbacks. You can write the commands
manually or edit commands obtained from a session journal file (either from the temporary journal
stored in your %TEMP% folder or from a journal generated by using the Record Journal menu option).
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
131
132
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Creating Wizards
def ValidateDialogProgress(step, prop):
thread = System.Threading.Thread(System.Threading.ParameterizedThreadStart(worker))
thread.Start(step)
def ValidatePropActivate(step, prop):
if prop.Value=="Yes":
step.NextStep.Enabled = True
else:
step.NextStep.Enabled = False
steps = step.UserInterface.GetPanel("Steps")
steps.UpdateData()
steps.Refresh()
def RefreshReport(step):
report = step.UserInterface.GetPanel("Report")
report.SetFilename(System.IO.Path.Combine(ExtAPI.Extension.InstallDir,"help","report.html"))
report.Refresh()
pass
This script defines all the actions executed by the callbacks in the XML file. Each step defined in the
XML file may include multiple actions. In our example XML extension file:
Step 1 (Geometry): The <onupdate> callback executes the CreateGeometry action and the <onreset> callback executes the DeleteGeometry action. These create a geometry on the Project
Schematic and delete it.
Step 2 (Mechanical): The <onupdate> callback executes the CreateMechanical action and the
<onreset> callback executes the DeleteMechanical action.
Step 3 (Fluent): The <onupdate> callback executes the CreateFluent action.
Actions executed by callbacks within property definitions are also defined.
Note
For a mixed wizard, the definition of the first step executed in the Project tab also specifies
the applications and component names from which subsequent steps will be executed. For
instance, in the excerpted code sample below, we can see that multiple actions are defined;
these will be called by the steps in the process definition file.
def action1(step):
template1 = GetTemplate( TemplateName="Static Structural", Solver="ANSYS")
system1 = template1.CreateSystem()
geometry1 = system1.GetContainer(ComponentName="Geometry")
geometry1.SetFile(FilePath=step.Properties["filename"].Value)
nextStep = step.NextStep
if nextStep!=None:
nextStep.SystemName = system1.Name
nextStep.ComponentName = "Geometry"
thirdStep = step.Wizard.Steps["Step3"]
if thirdStep!=None:
thirdStep.SystemName = system1.Name
thirdStep.ComponentName = "Model"
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
133
Note
For property-level help, it is recommended that you do not include images and limit the
message text to about 200 characters.
Help File Placement:
Non-AIM Wizards
For non-AIM wizards, help files can be stored in any folder inside the extension, so long as the relative
path is provided in the XML reference.
Important
When the extension is loaded to AIM, the folder will be copied into the
%AWP_ROOT171%\commonfiles\help\ACSHelpServer\docu_aim_html\custom directory for display in the help panel. The user must have access to this directory in order to
view the help for the custom template.
AIM Custom Templates
For AIM custom templates, help files must be stored in the extensions help folder.
Help File Naming References:
Step-Level Help
Step-level help is referenced by using the helpFile attribute in the XML step definition. The attribute
should be set to the relative path for the referenced help file.
The following example is a step-level help reference in a wizard. In this example, note that the help files
are located in a user-specified directory inside the extension called wizardhelp
<step name="Geometry" caption="Geometry" version="1" helpFile="wizardhelp/geometry.html">
134
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Creating Wizards
The following example is a step-level help reference in an AIM custom template. Note that the help files
are located in the extensions help directory, as required.
<step name="Geometry" caption="Geometry" version="1" context="Project" helpFile="help/geometry.html">
Property-Level Help
Property-level help files are referenced automatically according to filename; they do not need to be explicitly
referenced in the XML file. Once the helpFile attribute has been applied to a step, the extension will
automatically find and display the help files for properties defined within the step.
For examples of custom help implementation for wizards, see Project Wizard (Workbench Project
Tab)* (p. 236), Mechanical Wizard* (p. 254), and DesignModeler Wizard* (p. 251).
For examples of custom help implementation for AIM custom templates, see AIM Custom Template
(Single-Step) (p. 278) and AIM Custom Template (Multiple-Step) (p. 283).
You can change the location of this panel by customizing the layout of the wizard, as described in
Customizing the Layout of a Wizard (p. 136).
When an AIM custom template is executed:
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
135
Note
After moving to a new step, you must click on this icon to refresh the help panel with the
new content.
Property-level content is shown when you click the question mark (field-level help) icon that displays when
you mouse over a property.
136
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Creating Wizards
<component/>
<component/>
</layout>
</uidefinition>
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
137
The mandatory heightType, widthType, height, and width attributes define the dimensions of
the component. Possible values are as follows:
FitToContent: The component will have a default size that is set by ACT. When selected, the
height and width attributes become irrelevant.
Percentage: The height and width of the component will be expressed as percentages.
Fixed: The height and width of the component will be expressed in pixels.
The mandatory componentType attribute defines the type of component. Some examples of possible
component types are:
startPageHeaderComponent (Defines banner titles)
propertiesComponent
chartComponent
tabularDataComponent
buttonsComponent
stepsListComponent
The leftOffset, rightOffset, bottomOffset, and topOffset attributes specify the distance
and the margin between the different components.
The customCSSFile, customHTMLFile, and customJSFile attributes provide advanced capabilities to customize an entire component.
For an example of customizing a wizard interface, see Wizard Custom Layout Example (p. 290).
138
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Using Wizards
Using Wizards
This section discusses accessing and executing an installed and loaded wizard.
Related Topics:
Using a Workbench or Target Application Wizard
Using an AIM Custom Template
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
139
4. Click the wizard you want to run. Alternatively, you can select Execute Wizard from the wizard's
context or dropdown menu.
The wizard interface will open, showing the first step of the wizard.
Note
You can use the Search field to search for a wizard by the name, description, or
author of the extension. The case-insensitive search tool looks for all strings entered
that are separated by a blank (serving as the AND operation) and performs a combined search for strings separated by the OR operation.
140
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Using Wizards
Top: Shows general information about the wizard and a logo of your choice.
Left: Shows a list of the steps in the wizard, with the current step highlighted.
Right: Shows the data-entry and data-display fields for the selected step.
Bottom: Shows the custom help for the selected step.
Note
The overall content and function of the wizard interface is consistent across applications.
However, the display may vary slightly, depending on the application and any customizations
to the interface.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
141
Note
If you exit the wizard midway through, the changes to the project are retained and can
be saved, but the wizard itself is not. You cannot resume the wizard where you left off
when using the Exit Wizard button.
To exit the project with a wizard still in process, save the project and exit as usual. Upon reopening the
project, the wizard will still be in the state it was last saved in, so you can resume it where you left off.
142
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Using Wizards
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
143
In the example above, youd select a geometry, optionally change the value in the Number of
Analyses field, and click Create Simulation Process in order to create the simulation. The
custom template will then walk you through each step in the simulation process.
144
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
APIs Description
ACT supports application customization with a set of interfaces for each supported application. This
chapter details aspects of the APIs delivered by ACT. The high-level member interfaces of the APIs expose
the properties and methods that allow access to the applications underlying data.
The extensions that are loaded by the Workbench Extension Manager are each configured and initialized
to support Python scripting. For each extension, a global variable ExtAPI gives access to the
DataModel property. This property returns an IDataModel object, which has properties that return
all of the high-level interfaces available for customizations. The complete list of member interfaces is
given in the ANSYS ACT API Reference Guide.
Context
This is the framework-level command context. It provides additional entry points to the session and project
utilities, and is accessed as follows:
context = ExtAPI.DataModel.Context
Tasks
This is all of the tasks within the schematic, both ACT-defined and pre-installed tasks. It does not include
the master task level (i.e. ACT and schematic template-like tasks). Only concrete tasks instances are included. It is accessed as follows:
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
145
APIs Description
tasks = ExtAPI.DataModel.Tasks
Note
This section only provides the top-level API access points to schematic and workflow-related
data. For a comprehensive listing of API information for custom workflows, see the <workflow> section of the ACT API Reference Guide.
Using the APIs, you can both create new objects and modify existing ones.
Note
When you create a new object, Mechanical initializes the object's property values in the
Details window to the same default values used when you add an object via standard mouseclick operations. Some properties, such as scoping or the mass of a point mass, may be invalid
until you enter a value.
For more information on ANSYS Mechanical APIs and their properties, refer to the ANSYS ACT API Reference
Guide.
146
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Numerical Value (float and integer): A property, such as Relevance or Rate, expecting a numerical
value (a number for which a unit is not specified).
Example:
my_object.TetraGrowthRate = 2
Geometry Scoping: A property whose value is one or more geometric entities. In these cases, you must:
1. Create selection information and specify the Ids of the entities you want to manipulate.
2. Assign this list of Ids to the Location / SourceGeometry properties.
Example:
my_selection = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)
my_selection.Ids= [28,25]
My_object.Location = my_selection
147
APIs Description
4. Specify property values for the object.
It results in the creation of the point mass and activation of the pinball region in ANSYS Mechanical, as
shown below:
148
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
It results in the creation of a Patch Independent meshing control in ANSYS Mechanical, as shown below:
It results in the creation of a frictionless contact and beam connection in ANSYS Mechanical, as shown
below:
149
APIs Description
force_scoping.Ids = [219]
force.Location = force_scoping
force.Magnitude.Output.DiscreteValues=[Quantity('11.3 [N]'), Quantity('12.85 [N]')]
In our example, we apply the internal and external pressures to the pipe:
pressure.Magnitude.Output.Formula = '10*time'
pressure.Magnitude.Output.DiscreteValues=[Quantity('6 [Pa]')]
Note
If you use a constant ramped from t=0s to define the force, the first value cannot be
"0".
force.Magnitude.Output.DiscreteValues=[Quantity('11.3 [N]'), Quantity('12.85 [N]')]
Script execution results in the creation of a Magnitude property for the applied Force, with time as an
input variable and a single output variable:
Although initially we used tabular data to define the Magnitude property, we can also use a constant
value or a time- or space-dependent formula. Below is an example of how to use a constant value to
define the property:
force.Magnitude.Output.DiscreteValues=[Quantity('10 [N]')]
We can also opt to define the Magnitude property with global coordinates, instead of a vector, by using
the following commands:
150
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
It results in a solved analysis indicating the values for the Minimum and Maximum properties for the
Total Deformation result, as shown below:
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
151
APIs Description
The Python script function traversegeometry() demonstrates how an extension could traverse
the geometry data. In this example, an object of type IGeoData is obtained from the Analysis object
using the GeoData property. This GeoData object is then used to query for a list of IGeoAssembly
objects by calling the Assembly property. For each of the IGeoAssembly objects in the returned
list, the Parts property is called and a list of IGeoPart objects is returned. This pattern is repeated
through the hierarchy of the geometry down to the vertices of each edge.
Below is the content of the traversegeometry() function.
def traversegeometry(analysis):
now = datetime.datetime.now()
outFile = analysis.WorkingDir + "SolutionDetails.log"
f = open(outFile,'a')
f.write("*.*.*.*.*.*.*.*\n")
f.write(str(now)+"\n")
# --- IGeometry Interface
# +++ Properties and Methods
# +++
Assemblies
# +++
CellFromRefId
# +++
SelectedRefIds
geometry = analysis.GeoData
assemblies = geometry.Assemblies
assemblies_count = assemblies.Count
# --- IGeoAssembly Interface
# +++ Properties and Methods
# +++
Name
# +++
Parts
for assembly in assemblies:
assembly_name = assembly.Name
parts = assembly.Parts
parts_count = parts.Count
# --- IGeoPart Interface
# +++ Properties and Methods
# +++
Name
# +++
Bodies
for part in parts:
part_name = part.Name
bodies = part.Bodies
bodies_count = bodies.Count
# --- IGeoBody Interface
152
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
153
APIs Description
element IDs with the Elements property. For each of the element IDs in the returned list, the Element
method is called and the corresponding IElement object is returned. This pattern is repeated for all
the nodes for each element. Finally, the coordinates of the nodes are queried. Comments are included
in the example below to clarify script functionality.
Below is the content of the traversemesh() function.
def traversemesh(analysis):
now = datetime.datetime.now()
outFile = analysis.WorkingDir + "SolutionDetails.log"
f = open(outFile,'a')
f.write("*.*.*.*.*.*.*.*\n")
f.write(str(now)+"\n")
# --- IMesh Interface
# +++ Properties and Methods
# +++ MeshRegion
# +++ Node
# +++ Element
# +++ Nodes
# +++ Elements
# +++ NumNodes
# +++ NumElements
mesh = analysis.MeshData
elementids = mesh.ElementIds
# --- IElement Interface
# +++ Properties and Methods
# +++ Id
# +++ Type
# +++ Nodes
for elementid in elementids:
element = mesh.ElementById(elementid)
nodeids = element.NodeIds
# --- INode Interface
# +++ Properties and Methods
# +++ Id
# +++ X
# +++ Y
# +++ Z
# +++ Elements
for nodeid in nodeids:
node = mesh.NodeById(nodeid)
nodex = node.X
nodey = node.Y
nodez = node.Z
try:
f.write("
Element: "+elementid.ToString()+" Node: "+nodeid.ToString()+",
X = "+nodex.ToString()+", Y = "+nodey.ToString()+",
Z = "+nodez.ToString()+"\n")
except:
continue
f.close()
return
The Python script function elementcounter() demonstrates another example of how an extension
could access the mesh data. In this example, only the elements of user-selected geometry entities are
considered. First, the script obtains the IGeoData and IMeshData objects. Then the CurrentSelection.Ids property queries the IDs of the selected geometry entities using the ISelectionMgr
object. If no IDs are returned, a MessageBox displays the message "Nothing Selected." Otherwise, the
GeoEntityById and MeshRegionById methods obtain the IGeoEntity and IMeshRegion
objects corresponding to each selected entity. These two objects are used inside the try-except block
to query for the type of entity selected and the number of elements in each entity's mesh. The Type
property of the IGeoEntity interface and the NumElements property of the IMeshRegion interface
are used here and the results are displayed in a MessageBox.
def elementcounter(analysis):
geometry = analysis.GeoData
154
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Traversing Results
The Python function minmaxresults() computes the minimum and maximum component values
of the nodal displacement and the SXX stress component. It begins by instantiating a result reader using
the analysis.ResultsData method. Results are retrieved relative to the finite element model and
queried using either the elementID (elemental result) or the nodeID (nodal result). The displacement
result "U" is a nodal result, whereas the stress result "S" is a result on nodes of the elements. The displacement result stores a set of component values for each node, where the component names are X,
Y and Z.
The script minmaxresults first iterates over the nodeIDs to compute the minimum and maximum
values. Then, the script iterates over the elementIDs and the nodes of each element to compute the
minimum and maximum values.
Note
The second loop over the nodes is filtered to the primary nodes of the elements, since
stress results are available only on these primary nodes. Finally, the results are written
to the output file.
Below are the contents of the minmaxresults() function.
def minmaxresults(analysis):
now = datetime.datetime.now()
outFile = analysis.WorkingDir + "SolutionDetails.log"
f = open(outFile,'a')
f.write("*.*.*.*.*.*.*.*\n")
f.write(str(now)+"\n")
#
# Get the element ids
#
meshObj = analysis.MeshData
elementids = meshObj.ElementIds
nodeids = meshObj.NodeIds
#
# Get the results reader
#
reader = analysis.GetResultsData()
reader.CurrentResultSet = int(1)
#
# Get the displacement result object
disp = reader.GetResult("U")
num = 0
for nodeid in nodeids:
#
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
155
APIs Description
# Get the component displacements (X Y Z) for this node
#
dispvals = disp.GetNodeValues(nodeid)
#
# Determine if the component diplacement (X Y Z) is min or max
#
if num == 0:
maxdispx = dispvals[0]
mindispx = dispvals[0]
maxdispy = dispvals[1]
mindispy = dispvals[1]
maxdispz = dispvals[2]
mindispz = dispvals[2]
num += 1
if dispvals[0]
maxdispx =
if dispvals[1]
maxdispy =
if dispvals[2]
maxdispz =
if dispvals[0]
mindispx =
if dispvals[1]
mindispy =
if dispvals[2]
mindispz =
> maxdispx:
dispvals[0]
> maxdispy:
dispvals[1]
> maxdispz:
dispvals[2]
< mindispx:
dispvals[0]
< mindispy:
dispvals[1]
< mindispz:
dispvals[2]
156
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
This API allows access to toolbars and provides the ability to hide or gray-out ACT-based features. It
cannot be used to create new items (e.g., toolbars); it only provides access to existing UI elements.
ExtAPI.UserInterface.Toolbars is a collection of toolbar objects. Each object has fields to access
Name/Caption/Visibility/Child Entries. Each child has the following properties: Caption,
Enabled, Entries, EntryType, Name, and Visible.
The boolean fields Visible and Enabled can be set to "show" or "hide" so that the user can control
the availability of the buttons depending on the current context.
This command returns an ISelectionInfo object that describes the selected entities.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
157
APIs Description
To retrieve entities:
selection.Entities
Creating Primitives
The DesignModeler Primitives API provides you with the ability to create different types of primitive
bodies: sheet bodies, wire bodies, and solid bodies. For each primitive body type, multiple shape options
are available.
Figure 58: Primitive body type and shape options
158
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
In this example:
The width and height variables are used to define the width and the height of the cylinder.
The sheetBodies variable specifies the type of primitive to be created.
The primitive variable uses the global variable ExtAPI to access the data model and define the geometry
builder, which serves as entry point for ACT into DesignModeler.
The CreateCylinder () method is used to generate the new body, specifying that it is defined by the
following arguments:
Coordinates of the center point of the cylinders base
Coordinates of the center point of the upper face (which will define the direction of the cylinder)
Value of the radius
(This is a float. The integer value << 3 >>, for instance, will be refused, while a value of << 3. >>
will be accepted.)
With the cylinder_generated object, we use the Generate () method to generate the cylinder, as
shown below.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
159
APIs Description
Figure 59: Generation of sheet body cylinder primitive
In this example:
The points_list () method is defined for later use in the creation of the polyline body. For arguments,
it expects as a list of coordinate points (defined by three float values per point).
The primitive variable uses the global variable ExtAPI to access the data model and define the geometry
builder, which serves as entry point for ACT into DesignModeler.
The CreatePolyline () method is applied to the object Wire to generate the new body. As arguments,
this method is expecting the coordinate points defined by the points_list method above.
With the polyline_generated object, we use the Generate () method to generate the polyline, as
shown below.
160
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
The new body is added to the feature.bodies list, as described in Creating a Sheet Body (p. 159).
With the MaterialType line, we specify a material property of Add.
In this example:
The point1 () and point2 () methods are defined for later use in the creation of the solid body. For
arguments, they each expect as a list of coordinate points (defined by three float values per point).
The primitive variable uses the global variable ExtAPI to access the data model and define the geometry
builder, which serves as entry point for ACT into DesignModeler.
The CreateBox () method is applied to the object Solid to generate the new body. For arguments,
this method is expecting the coordinate points defined by the point1 and point2 methods above.
With the box1_generated object, we use the Generate () method to generate the box, as shown
below.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
161
APIs Description
Figure 61: Generation of solid body box primitive
The new body is added to the feature.bodies list, as described in Creating a Sheet Body (p. 159).
With the MaterialType line, we specify a material property of Freeze.
Applying Operations
The DesignModeler Operations API enables you to perform different operations on a geometric body.
Available operations can be divided into two different categories: Primary and Boolean Operations
and Tools Operations.
Figure 62: Operation types and options
162
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
In this example:
The first part of the function creates a polygon sheet body, using a process similar to the one used to create
a cylinder in Creating a Sheet Body (p. 159).
With the Extrude operation, we use the operations generator builder.Operations.CreateExtrudeOperation. The CreateExtrudeOperation method specifies that the operation is defined by
the following arguments:
Vector coordinates (which will define the direction of the extrusion)
Length of the extrusion
Note
In our example, the same Length variable is used for both the sheet body and the
extrusion definition. We also could have used a different variable for each.
The ApplyTo method specifies the geometry to which the extrude operation will be applied. The ApplyTo() method returns a list of bodies to which the operation will be applied.
With the lines bodies.Add(extrude.ApplyTo(polygon_generated)[0]) and feature.Bodies
= bodies, we add the extruded sheet body polygon to the feature.bodies list so it will be added to
DesignModeler after generation. Bodies not added to this list will not be retained.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
163
APIs Description
Figure 63: Application of the Extrude operation to a sheet body polygon
In this example:
The first part of the function creates a polygon sheet body, using a process similar to the one used to create
a cylinder in Creating a Sheet Body (p. 159).
With the body function, we use the operations generator builder.Operations.Tools.EdgesToWireBody. The EdgesToWireBody method specifies that the operation tool will transform the edges of the
sheet body polygon into a wire body.
Note
In our example, the same Length variable is used for multiple faces of the sheet body.
We also could have used a different variable for each face.
The new wire body is added to the feature.bodies list, as described in Applying the Extrude Operation (p. 163).
164
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
DOE APIs
This section discusses the APIs provided by ACT to customize DesignXplorer DOE functionality.
DOE Architecture
The object PSMtrxGenerator is responsible for the execution of the DOE. Regardless of whether the
sampling is built-in or external, it executes the same process via the sampling API.
The main elements of the API, shown below in Figure 65: DesignXplorer's Sampling Architecture (p. 166),
are as follows:
ISamplingMethod : the main interface between DX and the external sampling, which is required to implement it
IServices: the interface for the external sampling to access DX services, such as the calculation of one
or more points
DXPoint: the class that describes and stores the point data, such as variable values, calculation state, etc.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
165
APIs Description
Figure 65: DesignXplorer's Sampling Architecture
For more details about the API, see the "API Description" section for DesignXplorer in the ANSYS ACT
API Reference Guide.
166
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Optimization APIs
This section discusses the APIs provided by ACT to customize DesignXplorer optimization functionality.
Optimization Architecture
The object OptimizationEngineMgr is responsible for the execution of the optimization. Regardless
of whether the optimizer is built-in or external, it executes the same process via the optimization API.
The main elements of the API, shown below in Figure 67: DesignXplorer's Optimization Architecture (p. 168), are as follows:
IOptimizationMethod: the main interface between DX and the external optimizer, which is required
to implement it
IOptimizationServices: the interface for the external optimizer to access DX services, such as the
calculation of one or more points
DXOptimizationPoint: the class that describes and stores the points data, such as variable values, calculation state, etc.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
167
APIs Description
Figure 67: DesignXplorer's Optimization Architecture
For more details about the API, see the "API Description" section in the ANSYS ACT API Reference Guide.
168
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
169
170
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Associated Libraries
This chapter describes the libraries installed with ACT. These libraries include a set of Python functions
that can be used to develop extensions more efficiently.
The commands related to the examples provided below can be interactively tested using the ACT
Console. The ACT Console is installed with ACT. For more information, see ACT Console (p. 179).
The following sections describe a subset of the available libraries. You can access other libraries from
the ANSYS installation directory and consult the source code for a reference on their use. Libraries can
be found in the following folders in the %ANSYSversion_DIR%\..\Addins\ACT\libraries\
directory:
DesignModeler
ElectonicsDesktop
Fluent
Mechanical
Project
SpaceClaim
Study
Location
libraries/Mechanical/materials.py
libraries/Project/materials.py
libraries/Study/materials.py
Usage
import materials
Functions
GetListMaterialProperties(mat)
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
171
Associated Libraries
This function returns a list of property names for the material mat given in argument.
GetMaterialPropertyByName(mat, name)
This function returns the material property name for the material mat.
InterpolateData(vx, vy, vin)
This function computes a linear interpolation vout = f(vin) with f defined by vy = f(vx).
vx represents a list of values for the input variable.
vy represents a list of values for the property that depends on the input variable defined by vx.
vin is the value on which the function has to evaluate the property.
Example
This command:
import materials
mat = ExtAPI.DataModel.GeoData.Assemblies[0].Parts[0].Bodies[0].Material
materials.GetListMaterialProperties(mat)
This command:
prop = materials.GetMaterialPropertyByName(mat,"Elasticity")
prop
This command:
val = materials.InterpolateData(prop["Temperature"][1:],prop["Young's Modulus"][1:],10.)
val
val = materials.InterpolateData(prop["Temperature"][1:],prop["Young's Modulus"][1:],20.)
val
172
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Units Conversion
Units Conversion
Description
This library implements a set of functions to manipulate the unit dependent quantities within an extension. This library is of particular interest each time quantities have to remain consistent with the current
unit system activated in the application.
Location
libraries/DesignModeler/materials.py
libraries/ElectonicsDesktop/materials.py
libraries/Fluent/materials.py
libraries/Mechanical/materials.py
libraries/Project/materials.py
libraries/SpaceClaim/materials.py
libraries/Study/materials.py
Usage
import units
Function
ConvertUnit(value,fromUnit,toUnit[,quantityName])
This function converts the value from the unit fromUnit to the unit toUnit. The user can specify
the quantity name to avoid conflict during conversion. This quantity name is not mandatory.
Example
This command:
import units
units.ConvertUnit(1,"m","mm")
Function
ConvertUserAngleUnitToDegrees(api, value)
This function converts the angle value to the unit degrees. If the current activated unit is already degrees, then the value remains unchanged.
Example
This command:
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
173
Associated Libraries
import units
units.ConvertUserAngleUnitToDegrees(api,3.14)
returns
180. if the angle unit is set to radius when the command is called
3.14 if the angle unit is set to degrees when the command is called
Function
ConvertToSolverConsistentUnit(api, value, quantityName, analysis)
This function converts the valueof the quantity quantityName from the currently activated unit in
the application to the corresponding consistent unit used by the solver for the resolution of the analysis
analysis.
Example
This command:
import units
units.ConvertToSolverConsistentUnit(api,1.,pressure,Static Structural)
returns
10. if the unit system is set to Metric(mm,dat,N,s,mV,mA) when the command is called
Function
ConvertToUserUnit(api, value, fromUnit, quantityName)
This function converts the value of the quantity quantityName from the unit fromUnit to the
currently activated unit system in the application.
Example
This command:
import units
units.ConvertToUserUnit(api,1.,m,length)
returns
1000. if the current activated unit is millimeter when the command is called
Function
ConvertUnitToSolverConsistentUnit(api, value, fromUnit, quantityName, analysis)
This function converts the valueof the quantity quantityName from the unit fromUnit to the
consistent unit that is used by the solver for the resolution of the analysis analysis.
Example
This command:
import units
units.ConvertUnitToSolverConsistentUnit(api,1.,m,length,Static Structural)
returns
174
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
MAPDL Helpers
1000. if the consistent unit is millimeter when the command is called
Function
GetMeshToUserConversionFactor(api)
This function returns the scale factor to be applied to convert a length from the unit associated to the
mesh and the currently activated unit in the application.
Example
This command:
import units
units.GetMeshToUserConversionFactor(api)
returns
1000. if the unit associated to the mesh is meter and if the current activated unit in the application
is millimeter.
MAPDL Helpers
Description
This library implements some helpers to write APDL command blocks or to execute ANSYS Mechanical
APDL programs.
Location
libraries/ElectronicsDesktop/ansys.py
libraries/Fluent/ansys.py
libraries/Mechanical/ansys.py
libraries/Project/ansys.py
libraries/Study/ansys.py
Usage
import ansys
Functions
createNodeComponent(refIds,groupName,mesh,stream,fromGeoIds=True)
This function writes the APDL command block (CMBLOCK) for the creation of a node component related
to the geometry entities identified by refIds into the stream stream. refIds refer to geometric IDs
if fromGeoIds is true and the node IDs are retrieved from geometric entities using the associativity
between the geometry and mesh. If fromGeoIds is false, then refIds refer directly to the node IDs to
be written in the component.
createElementComponent(refIds,groupName,mesh,stream,fromGeoIds=True)
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
175
Associated Libraries
This function writes the APDL command block (CMBLOCK) for the creation of an element component
related to the geometry entities identified by refIds into the stream stream. refIds refer to geometric
IDs if fromGeoIds is true and the element IDs are retrieved from geometric entities using the associativity between the geometry and the mesh. If fromGeoIds is false, the refIds refer directly to the
element IDs to be written in the component.
RunANSYS(api,args,[runDir[,exelocation]])
This function calls the ANSYS Mechanical APDL program with the command line initialized by args.
The user can specify the folder from which he wants to execute the program with runDir. The location
of the executable is also managed with exelocation.
api parameter must be ExtAPI.
Example
import ansys
ansys.createNodeComponent([refId],"myGroup",mesh,stream)
ansys.RunANSYS(ExtAPI,"")
Journaling Helper
Description
This library implements a helper that can be used to transfer data between Mechanical and the Project
page.
Location
libraries/Mechanical/ansys.py
libraries/Project/ansys.py
libraries/Study/ansys.py
Usage
import wbjn
Functions
ExecuteCommand(api,cmd,**args)
This function executes a journal command specified by cmd You can get a result object by using the
function returnValue(obj) in your journal command. All arguments must implement the serialization
interface provided by .Net. The object sent to the function returnValue(obj) must also implement
the serialization interface. This interface is already implemented for many standard types of data (integer,
double, list). Please note that the standard Python dictionary does not implement this interface by
default. If a dictionary is required, use the SerializableDictionary class provided by ACT.
api parameter must be ExtAPI.
ExecuteFile(api,file,**args)
176
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Journaling Helper
Examples
This command:
import wbjn
wbjn.ExecuteCommand(ExtAPI,"returnValue(a+b)",a=2,b=3)
This command:
import wbjn
wbjn.ExecuteCommand(ExtAPI,"returnValue(a+GetAllSystems()[0].DisplayText+b)",
a="My first system is: ",b=" !")
This command:
import wbjn
dict = SerializableDictionary[str,int]()
dict.Add("e1",1)
dict.Add("e2",2)
wbjn.ExecuteCommand(ExtAPI,'returnValue(d["e1"]+d["e2"])', d=dict)
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
177
178
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Note
Most development and debugging tools also have at least one alternate method of access;
where applicable, these alternate access points are noted in the discussion of the tool.
ACT Console
The ACT Console is an ACT tool that can be used to interactively test commands during the development
or debugging of an extension. It is available by default in Workbench, AIM, and the Mechanical application.
In Workbench or AIM:
You can open the ACT Console in either of the following ways:
Click the corresponding icon on the ACT Start Page.
Select the Extensions>View ACT Console menu option in Workbench or AIM
The ACT Console window can be resized, repositioned, and kept open as you switch between applications.
In Mechanical:
You can open and close the ACT Console by clicking the View ACT Console toolbar icon.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
179
180
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
ACT Console
Key Combination
Action
Shift + Enter
Enter
Item Type
Black
Inputs
Blue
Outputs
Red
Errors
To move between commands in the history, use the following key combinations:
Key Combination
Action
Ctrl + up-arrow
Ctrl + down-arrow
For a comprehensive listing of the keyboard shortcuts available for the ACT Console, see ACT Console
Keyboard Shortcuts (p. 187).
You can use the following toolbar icons to work with the contents of the command history window:
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
181
Using Auto-Completion
The ACT Console provides "smart" auto-completion, which means it takes syntax elements such as
brackets or quotations marks into account. As you type, a scrollable list of property, method, and
keyword suggestions is displayed above the command line.
Each suggestion has a gray icon with a letter indicating the type of suggestion:
M = Method
P = Property
N = Namespace
E = Enumeration
V = Variable
T = Type
Figure 70: ACT Console Auto-Completion Suggestions and Property Tooltip
182
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
ACT Console
Methods:
ArgumentType (ArgumentName): ReturnType
ArgumentName: Description of the argument.
Tooltips use color-coding to indicate the syntax, as follows:
green = accessibility
purple = type
orange = warning
blue = arguments
Figure 71: Tooltip Color-Coding
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
183
Action
Ctrl + space
Esc
Enter
space or symbol
Supported symbols:
.( ) [ ] { } # ,;:! / = ?
For a comprehensive listing of the keyboard shortcuts available for the ACT Console, see ACT Console
Keyboard Shortcuts (p. 187).
Using Bookmarks
The ACT Console bookmarking feature enables you to bookmark predefined commands for later insertion
into the command line editor. Saved bookmarks are displayed in the Bookmarks pane and can be organized into folders.
Using the Toolbar
You can use the following toolbar icons and context menu to work with bookmarks:
Icons:
184
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
ACT Console
2. Add a new bookmark folder.
3. Import an existing bookmarks collection.
4. Export the current bookmarks collection.
5. Show hidden icons; only displayed when the console window is not wide enough to display all icons
in the toolbar.
Context Menu:
Folder
Bookmark
Whitespace
You can then enter the new bookmarks details in the Bookmark Properties dialog.
Viewing/Editing Bookmark or Folder Properties
You can view or edit the properties of a bookmark or folder in the Bookmark Properties dialog. You can
access this dialog by either of the following methods:
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
185
Note
If you delete a folder, all of its contents will be deleted as well.
Organizing Bookmarks and Folders
When creating a new bookmark or folder, you can determine its location by using a particular creation
method, as described in Creating New Bookmarks or Folders (p. 185).
You can organize existing bookmarks or folders by dragging them to the desired location in the
tree.
Importing and Exporting Bookmarks
You can import or export collections of bookmarks as an XML file. To do so, click the Import an existing
bookmarks collection or Export the current bookmarks collection toolbar icon.
For example, Figure 73: Exporting Bookmarks (p. 186) shows a list of bookmarks and the XML file
that would result from an export of the list.
Figure 73: Exporting Bookmarks
186
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
ACT Console
Action
Ctrl + D
Remove line
Copy lines up
Alt + down-arrow
Alt + up-arrow
Move lines up
Alt + Backspace
Alt + Delete
Ctrl + Delete
Ctrl + Backspace
Table 2: Selection
Key Combination
Action
Ctrl + A
Select all
Shift + left-arrow
Select left
Shift + right-arrow
Select right
Shift + Home
Shift + End
Shift + up-arrow
Select up
Shift + down-arrow
Select down
Shift + Page Up
Select page up
Select to start
Select to end
Ctrl + Shift + D
Duplicate selection
Ctrl + Shift + P
Table 3: Multi-Cursor
Key Combination
Action
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
187
Action
Ctrl + Shift + L
Table 4: Go-To
Key Combination
Action
Page Up
Go to page up
Page Down
Go to page down
Ctrl + Home
Go to start
Ctrl + End
Go to end
Ctrl + L
Go to line
Ctrl + P
Go to matching bracket
Table 5: Folding
Key Combination
Action
Alt + L, Ctrl + F1
Fold selection
Unfold
Table 6: Other
Key Combination
Action
Tab
Indent
Shift + Tab
Outdent
Ctrl + Z
Undo
Redo
Ctrl + T
Transpose letters
Ctrl + Shift + U
Change to lower-case
Ctrl + U
Change to upper-case
Insert
Overwrite
188
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
189
Debug Mode
When developing an extension, we recommend that you enable Debug mode. You can enable/disable
Debug mode via the Debug Mode option on the Extensions tab of the Options dialog (accessed via
the Tools>Options menu)
190
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Debug Mode
Figure 77: Enabling Debug Mode via the Options Dialog
When you enable Debug mode, access points to debugging features are provided in Workbench,
Mechanical, and DesignModeler.
Workbench
In Workbench, Debug mode is activated as soon as the option is enabled.
The Reload Extensions button is added to the Workbench toolbar. It allows you to reload the extensions currently loaded from the Workbench interface; it persists throughout all the native
Workbench tabs (such as Project, Engineering Data, Parameter Set, and DesignXplorer). For more
information, see Reload Extensions (p. 192).
Mechanical and DesignModeler
In Mechanical and DesignModeler, Debug mode is activated and debugging functionality is available the
next time the application is launched. If the application is already open when the Debug mode is activated,
you must exit and reopen it.
The ACT Development toolbar is added to the Mechanical and DesignModeler applications. It includes two buttons: Reload extensions and View log file.
Figure 78: ACT Development Toolbar in Mechanical and DesignModeler
1. Reload extensions: Reloads the currently loaded extensions. For more information, see Reload Extensions (p. 192).
2. View log file: Opens the extension log file. For more information, see Extensions Log File (p. 192).
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
191
Reload Extensions
The Reload Extensions tool gives you the ability to reload the currently loaded extensions without
having to leave the current application.
This feature is particularly useful during the development of an extension, as it provides an efficient
method of interactively testing the changes in an XML file or Python function. For major changes, you
can ensure that an object acts as expected by deleting the previously-defined ACT objects and then
recreating them.
You can reload extensions in any of the following ways:
the Reload Extensions button on the Workbench or AIM toolbar (Debug mode)
Figure 79: Reload Extensions Button in Workbench or AIM
the Reload Extensions button on the Mechanical or DesignModeler ACT Development toolbar (Debug
mode)
Figure 80: ACT Development Toolbar in Mechanical and DesignModeler
192
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
You can access the extension log file in any of the following ways:
the corresponding icon on the ACT Start Page
the Extensions>View Log File menu option
the View Log File button on the Mechanical and DesignModeler ACT Development toolbar (Debug mode)
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
193
4. After attaching the process, open your Python code and set some breakpoints into it.
194
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Advanced Programming in C#
This section explains how to replace IronPython code with C# assemblies. C# is used in this document
but any language that creates .NET assemblies can also be used for that purpose. This section assumes
that you already know how to create an assembly in C#.
C# provides two major advantages over IronPython:
Better performance
Superior development environment which provides auto completion.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
195
Advanced Programming in C#
In the definition of the load object, the only change is the use of the attribute class. This attribute must
be set to the name of the class to be used for the integration of the load.
The CSharp.Load class is described below:
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Text;
Ansys.ACT.Interfaces.Mechanical;
Ansys.ACT.Interfaces.UserObject;
namespace CSharp
{
public class Load
{
IMechanicalExtAPI _ExtAPI = null;
public Load(IMechanicalExtAPI extApi,IUserLoad load)
{
_ExtAPI = extApi;
}
public IEnumerable<double> getnodalvaluesfordisplay(ISimLoad load, IEnumerable<int> nodeIds)
{
List<double> res = new List<double>();
var mesh = load.Analysis.MeshData;
foreach (int nodeId in nodeIds)
{
var node = mesh.NodeById(nodeId);
res.Add(Math.Sqrt(node.X * node.X + node.Y * node.Y + node.Z * node.Z));
}
return res;
}
}
}
To implement a callback in C#, create a new method in your class with the name of the callback in
lower case.
In the example, you implement the callback <getnodalvaluesfordisplay> by adding the method
getnodalvaluesfordisplay to the class.
196
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
For the load definition, the attribute class must be set to the name of the class to be used for the
integration of the result.
The CSharp.Result class is described below:
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Text;
Ansys.ACT.Interfaces.Mechanical;
Ansys.ACT.Interfaces.Post;
Ansys.ACT.Interfaces.UserObject;
namespace CSharp
{
public class Result
{
internal double[] res = new double[1];
public Result(IMechanicalExtAPI extApi, IUserResult result)
{
}
public void evaluate(IUserResult entity, IStepInfo stepInfo, IResultCollector collector)
{
foreach (var id in collector.Ids)
{
res[0] = id;
collector.SetValues(id, res);
}
}
}
}
As for the load definition, the implementation of a new callback simply requires you add a new method
with the name of the callback.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
197
198
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Examples
ACT supports application customization by exposing a set of interfaces for each supported application.
The examples in this section build upon the methods and techniques discussed in the previous chapters.
Examples are provided for the following areas:
Mechanical Extension Examples
DesignXplorer Extension Examples
Custom ACT Workflows in Workbench Examples
Wizard Examples
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
199
Examples
<callbacks>
<evaluate>Mises_At_Nodes_Eval</evaluate>
</callbacks>
<property name="Geometry" caption="Geometry" control="scoping"></property>
</result>
</simdata>
</extension>
Figure 82: Von-Mises Stress Details (p. 200) shows how the toolbar and result are added to the ANSYS
Mechanical user interface.
Figure 82: Von-Mises Stress Details
The Python script for the Mises extension, shown below, defines a callback function named <Create_Mises_Result>. When activated by the Von Mises Stress toolbar button, this callback creates
the result Von Mises Stress. The callback invokes the Create_Mises_Result method on the simDataMgr interface. The Mises.xml file provides the details needed to create the Von Mises Stress
toolbar/button and result.
In addition, the main.py file contains all the Python functions useful for this extension.
At the top of the script is the list definition for the node adjacency tables. The list, named "link," is a
list of hash maps. Each hash map uses as its hash key the numeral corresponding to the type returned
by the IElementType property. The value for hash map is a list of arrays. The names of the arrays
match the local node numbers for a typical element of the key (element-type). Finally, the content of
each array provides the adjacent local node numbers for the corresponding elements node. This list of
200
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
The <evaluate> callback associated with the Mises_At_Nodes_Eval function is invoked as the
result of an event thrown by the ANSYS Mechanical application. The Mises_At_Nodes_Eval function
computes the appropriate stress results and stores them. (The comments in the script below describe
the algorithm used.) It returns the nodal results set stored for the specified node ID. This callback is
used by the graphics system to display the results.
The Python script example also demonstrates the use of utility sub-functions. Using sub-functions to
perform common repetitive task helps to make the script modular and more understandable. The utility
sub-functions used in here are Mises and EigenValues. Mises is called by
Mises_At_Nodes_Eval and returns the computed equivalent stress for a given stress tensor
(SX,SY,SZ,SXY,SXZ,SYZ). The function EigenValues is used by the Mises function to compute the
Eigen vectors for a given stress tensor.
import units
import math
if ExtAPI.Context == 'Mechanical':
link = {}
#kHex20
link.Add(ElementTypeEnum.kHex20,{ 0:[3,1,4], 1:[0,2,5], 2:[1,3,6], 3:[2,0,7], 4:[5,0,7], 5:[1,4,6],
6:[5,7,2], 7:[6,3,4], 8:[0,1], 9:[1,2], 10:[2,3], 11:[3,0], 12:[4,5], 13:[5,6], 14:[6,7],
15:[7,4], 16:[0,4], 17:[1,5], 18:[2,6], 19:[3,7]})
#kHex8
link.Add(ElementTypeEnum.kHex8,{ 0:[3,1,4], 1:[0,2,5], 2:[1,3,6], 3:[2,0,7], 4:[5,0,7], 5:[1,4,6],
6:[5,7,2], 7:[6,3,4]})
#kPyramid13
link.Add(ElementTypeEnum.kPyramid13,{ 0:[3,1,4], 1:[0,2,4], 2:[1,3,4], 3:[2,0,4], 4:[0,1,2,3],
5:[0,1], 6:[1,2], 7:[2,3], 8:[3,0], 9:[0,4], 10:[1,4], 11:[2,4], 12:[3,4]})
#kPyramid5
link.Add(ElementTypeEnum.kPyramid5,{ 0:[3,1,4], 1:[0,2,4], 2:[1,3,4], 3:[2,0,4], 4:[0,1,2,3]})
#kQuad4
link.Add(ElementTypeEnum.kQuad4, { 0:[3,1], 1:[0,2], 2:[1,3], 3:[2,0]})
#kQuad8
link.Add(ElementTypeEnum.kQuad8, { 0:[3,1], 1:[0,2], 2:[1,3], 3:[2,0], 4:[0,1], 5:[1,2], 6:[2,3],
7:[3,0]})
#kTet10
link.Add(ElementTypeEnum.kTet10,{ 0:[2,1,3], 1:[0,2,3], 2:[1,0,3], 3:[0,1,2], 4:[0,1], 5:[1,2],
6:[2,0], 7:[0,3], 8:[1,3], 9:[2,3]})
#kTet4
link.Add(ElementTypeEnum.kTet4, { 0:[2,1,3], 1:[0,2,3], 2:[1,0,3], 3:[0,1,2]})
#kTri3
link.Add(ElementTypeEnum.kTri3, { 0:[2,1], 1:[0,2], 2:[1,0]})
#kTri6
link.Add(ElementTypeEnum.kTri6, { 0:[2,1], 1:[0,2], 2:[1,0], 3:[0,1], 4:[1,2], 5:[2,3]})
#kWedge15
link.Add(ElementTypeEnum.kWedge15,{ 0:[2,1,3], 1:[0,2,4], 2:[1,0,5], 3:[5,4,0], 4:[3,5,1],
5:[4,3,2], 6:[0,1], 7:[1,2], 8:[2,0], 9:[3,4], 10:[4,5], 11:[5,3], 12:[0,3], 13:[1,4],
14:[2,5]})
#kWedge6
link.Add(ElementTypeEnum.kWedge6,{ 0:[2,1,3], 1:[0,2,4], 2:[1,0,5], 3:[5,4,0], 4:[3,5,1],
5:[4,3,2]})
def Create_Mises_Result(analysis):
analysis.CreateResultObject("Von Mises Stress")
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
201
Examples
# This function evaluates the specific result (i.e. the Von-Mises stress) on each element
# required by the geometry selection
# The input data "step" represents the step on which we have to evaluate the result
def Mises_At_Nodes_Eval(result, stepInfo, collector):
ExtAPI.Log.WriteMessage("Launch evaluation of the Mises result at nodes: ")
# Reader initialization
reader = result.Analysis.GetResultsData()
step = int(stepInfo.Set)
reader.CurrentResultSet = step
# Get the stress result from the reader
stress = reader.GetResult("S")
unit_stress = stress.GetComponentInfo("X").Unit
conv_stress = units.ConvertUnit(1.,unit_stress,"Pa","Stress")
# Get the selected geometry
prop_geo = result.Properties["Geometry"]
ref_ids = prop_geo.Value.Ids
nodal_stress = [0.] * 6
# Get the mesh of the model
mesh = result.Analysis.MeshData
# Loop on the list of the selected geometrical entities
for ref_id in ref_ids:
# Get mesh information for each geometrical entity
mesh_region = mesh.MeshRegionById(ref_id)
node_ids = mesh_region.NodeIds
# Loop on the nodes related to the current geometrical refId
for node_id in node_ids:
for i in range(6):
nodal_stress[i] = 0.
element_ids = mesh.NodeById(node_id).ConnectedElementIds
num = 0
# Loop on the elements related to the current node
for element_id in element_ids:
# Get the stress tensor related to the current element
tensor = stress.ElementValue(element_id,"X;Y;Z;XY;XZ;YZ")
element = mesh.ElementById(element_id)
# Look for the position of the node nodeId in the element element_id
# cpt contains this position
cpt = element.NodeIds.IndexOf(node_id)
# for corner nodes, cpt is useless.
# The n corner nodes of one element are always the first n nodes of the list
if cpt < element.CornerNodeIds.Count:
for i in range(6):
nodal_stress[i] = nodal_stress[i] + tensor[6*cpt+i]
else:
# For midside nodes, cpt is used and the link table provides the two neighbouring
# corner nodes for the midside node identified in the list by cpt
itoadd = link[element.Type][cpt]
for ii in itoadd:
for i in range(6):
nodal_stress[i] = nodal_stress[i] + tensor[6*ii+i] / 2.
num += 1
# The average stress tensor is computed before to compute the Von-Mises stress
# num is the number of elements connected with the current node node_id
for i in range(6):
nodal_stress[i] *= conv_stress / num
# Von-Mises stress computation
vm_stress = Mises(nodal_stress)
202
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
# This function computes the Von-Mises stress from the stress tensor
# The Von-Mises stess is computed based on the three eigenvalues of the stress tensor
def Mises(tensor):
# Computation of the eigenvalues
(S1, S2, S3) = Eigen_Values(tensor)
return sqrt( ( (S1-S2)*(S1-S2) + (S2-S3)*(S2-S3) + (S1-S3)*(S1-S3) ) / 2. )
# This function computes the three eigenvalues of one [3*3] symetric tensor
EPSILON = 1e-4
def Eigen_Values(tensor):
a
b
c
d
e
f
=
=
=
=
=
=
tensor[0]
tensor[1]
tensor[2]
tensor[3]
tensor[4]
tensor[5]
= -2*R*cos(phi/3)-A/3
= -2*R*cos(phi/3+2*math.pi/3)-A/3
= -2*R*cos(phi/3+4*math.pi/3)-A/3
= a
= b
= c
203
Examples
to synchronize tree view selections with the content of the graphics pane. The details needed to define
the inputs and behavior of this special load consists of the three properties, Source, Target and Reverse,
along with their behavioral callbacks.
<extension version="1" name="Coupling">
<guid shortid="Coupling">e0d5c579d-0263-472a-ae0e-b3cbb9b74b6c</guid>
<script src="main.py" />
<interface context="Mechanical">
<images>images</images>
<toolbar name="Coupling" caption="Coupling">
<entry name="Coupling" icon="support">
<callbacks>
<onclick>CreateCoupling</onclick>
</callbacks>
</entry>
</toolbar>
</interface>
<simdata context="Mechanical">
<load name="Coupling" version="1" caption="Coupling" icon="support" issupport="true"
color="#FF0000">
<callbacks>
<getsolvecommands>SolveCmd</getsolvecommands>
<onshow>ShowCoupling</onshow>
<onhide>HideCoupling</onhide>
</callbacks>
<property name="Source" caption="Source" control="scoping">
<attributes selection_filter="edge" />
<callbacks>
<isvalid>IsValidCoupledScoping</isvalid>
<onvalidate>OnValidateScoping</onvalidate>
</callbacks>
</property>
<property name="Target" caption="Target" control="scoping">
<attributes selection_filter="edge" />
<callbacks>
<isvalid>IsValidCoupledScoping</isvalid>
<onvalidate>OnValidateScoping</onvalidate>
</callbacks>
</property>
<property name="Reverse" caption="Reverse" control="select" default="No">
<attributes options="No,Yes" />
<callbacks>
<onvalidate>OnValidateReverse</onvalidate>
</callbacks>
</property>
</load>
</simdata>
</extension>
Figure 83: Fully-defined Coupling in Mechanical (p. 205) shows how a fully defined coupling appears in
ANSYS Mechanical.
204
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
The Python script for the Coupling extension, shown below, defines a callback function named <CreateCoupling>. When activated by the Coupling toolbar button, this callback creates the load
Coupling. The callback invokes the CreateLoadObject method for the current analysis. The function
SolveCmd is called when the solver input is being generated. SolveCmd invokes GetListNodes
to obtain two lists of nodeids corresponding to the Target and Source edges. These nodeids are
then used to write APDL CP commands to the solver input. GetListNodes is also invoked by the
<ShowCoupling> callback function. In <ShowCoupling>, the IGraphics interface is used to
create a graphics context. Using the object returned, the inter-nodal lines are drawn to provide a visual
representation of the coupling.
The graphics context associated with this custom load and the validation of the user inputs impose to
manage more various situations than for the first example described in the previous section. This explains
why more functions and sub-functions are required for this example.
import graphics
def CreateCoupling(analysis):
analysis.CreateLoadObject("Coupling")
#------------------------------#
Callbacks
#------------------------------def OnValidateReverse(load, prop):
ShowCoupling(load)
def OnValidateScoping(load, prop):
ShowCoupling(load)
def IsValidScoping(load, prop):
if not prop.Controller.isvalid(load, prop):
return False
selection = prop.Value
if selection == None: return False
if selection.Ids.Count != 1: return False
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
205
Examples
return True
def IsValidCoupledScoping(load, prop):
sProp = load.Properties["Source"]
tProp = load.Properties["Target"]
if not IsValidScoping(load, sProp):
return False
if not IsValidScoping(load, tProp):
return False
sIds = sProp.Value.Ids
tIds = tProp.Value.Ids
try:
mesh = load.Analysis.MeshData
sNum = mesh.MeshRegionById(sIds[0]).NodeCount
tNum = mesh.MeshRegionById(tIds[0]).NodeCount
if sNum == 0 or tNum == 0: return False
except:
return False
def ShowCoupling(load):
delContext(load)
ctxCoupling = ExtAPI.Graphics.CreateAndOpenDraw3DContext()
sourceColor = load.Color
targetColor = 0x00FF00
lineColor
= 0x0000FF
sProp = load.Properties["Source"] ; sSel = sProp.Value
tProp = load.Properties["Target"] ; tSel = tProp.Value
ctxCoupling.LineWeight = 1.5
if sSel != None:
ctxCoupling.Color = sourceColor
for id in sSel.Ids:
graphics.DrawGeoEntity(ExtAPI, load.Analysis.GeoData, id, ctxCoupling)
if tSel != None:
ctxCoupling.Color = targetColor
for id in tSel.Ids:
graphics.DrawGeoEntity(ExtAPI, load.Analysis.GeoData, id, ctxCoupling)
if IsValidSelections(load):
206
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
#------------------------------#
Commands
#------------------------------def SolveCmd(load, s):
s.WriteLine("! Coupling - CP")
sList, tList = GetListNodes(load)
for sId, tId in zip(sList, tList):
s.WriteLine("CP,NEXT,ALL,{0},{1}", sId, tId)
#------------------------------#
Utils
#------------------------------def IsValidSelections(load):
return load.Properties["Source"].IsValid and load.Properties["Target"].IsValid
def GetListNodes(load):
if IsValidSelections(load):
sProp = load.Properties["Source"] ; sIds = sProp.Value.Ids
tProp = load.Properties["Target"] ; tIds = tProp.Value.Ids
geometry = ExtAPI.DataModel.GeoData
mesh = load.Analysis.MeshData
sList = GetSubListNodes(geometry, mesh, sIds[0])
tList = GetSubListNodes(geometry, mesh, tIds[0])
rev = False
r = load.Properties["Reverse"].Value
if r == "Yes": rev = True
sList = sorted(sList, key=sList.get)
tList = sorted(tList, key=tList.get, reverse=rev)
return (sList, tList)
def GetSubListNodes(geometry, mesh, refId):
entity = geometry.GeoEntityById(refId)
region = mesh.MeshRegionById(refId)
result = {}
pt = System.Array.CreateInstance(System.Double, 3)
for nodeId in region.NodeIds:
node = mesh.NodeById(nodeId)
pt[0], pt[1], pt[2] = (node.X, node.Y, node.Z)
result[nodeId] = entity.ParamAtPoint(pt)
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
207
Examples
return result
Description
PythonSampling
CSharpSampling
Description
PythonOptimizer
208
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
CppOptimizer
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
209
Examples
210
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
IronPython Script
The IronPython script (main.py) contains the Python code defining the methods invoked by the
global callbacks. This script:
Defines 23 methods:
One method for each of the 22 global callback defined in the XML definition file.
One method to format a message to write to the command line window.
Specifies (via the method arguments) that the onBeforeUpdate and onAfterUpdate methods should
be executed only for updates of Engineering Data tasks.
The file, main.py, contains the following code:
def onBeforeReset(task):
msg = getPrintMessage('pre-reset', task)
print msg
def onAfterReset(task):
msg = getPrintMessage('post-reset', task)
print msg
def onBeforeRefresh(task):
msg = getPrintMessage('pre-refresh', task)
print msg
def onAfterRefresh(task):
msg = getPrintMessage('post-refresh', task)
print msg
def onBeforeUpdate(task):
if task.Name == "Engineering Data":
msg = getPrintMessage('post-update', task)
print msg
else:
print("ignored")
def onAfterUpdate(task):
if task.Name == "Engineering Data":
msg = getPrintMessage('post-update', task)
print msg
else:
print("ignored")
def onBeforeDuplicate(task):
msg = getPrintMessage('pre-duplicate', task)
print msg
def onAfterDuplicate(task):
msg = getPrintMessage('post-duplicate', task)
print msg
def onBeforeSourcesChanged(task):
msg = getPrintMessage('pre-sources-changed', task)
print msg
def onAfterSourcesChanged(task):
msg = getPrintMessage('post-sources-changed', task)
print msg
def onBeforeCreate(task):
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
211
Examples
msg = getPrintMessage('pre-creation', task)
print msg
def onAfterCreate(task):
msg = getPrintMessage('post-creation', task)
print msg
def onBeforeDelete(task):
msg = getPrintMessage('pre-deletion', task)
print msg
def onAfterDelete(task):
msg = getPrintMessage('post-deletion', task)
print msg
def onBeforeCanUseTransfer(sourceTask, targetTask):
msg = 'in pre-can-use-transfer with source task ' + sourceTask.Name +
' and target task ' + targetTask.Name
print msg
def onAfterCanUseTransfer(sourceTask, targetTask):
msg = 'in post-can-use-transfer with source task ' + sourceTask.Name +
' and target task ' + targetTask.Name
print msg
def onBeforeCanDuplicate():
msg = getPrintMessage('pre-can-use-transfer', None)
print msg
def onAfterCanDuplicate():
msg = getPrintMessage('post-can-use-transfer', None)
print msg
def onBeforeStatus(task):
msg = getPrintMessage('pre-status', task)
print msg
def onAfterStatus(task):
msg = getPrintMessage('post-status', task)
print msg
def onBeforePropertyRetrieval(task):
msg = getPrintMessage('pre-property', task)
print msg
def onAfterPropertyRetrieval(task):
msg = getPrintMessage('post-property', task)
print msg
def getPrintMessage(msg, task):
taskName = 'none'
if task != None:
taskName = task.Name
return 'in ' + msg + ' callback for task ' + taskName
212
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
213
Examples
<taskgroups>
<taskgroup name="Empty" caption="Empty" icon="Generic" category="ACT Custom Workflows"
abbreviation="MT" version="1">
<includeTask name="Empty" caption="Empty"/>
</taskgroup>
</taskgroups>
</workflow>
</extension>
IronPython Script
The IronPython script (empty_gui.py) contains the Python code the task executes from the context
menu and update callbacks.
Since the XML extension definition file has both the <onupdate> and <onclick> callbacks, the update
and click methods are defined in the script.
The file, empty_gui.py, contains the following code:
import clr
clr.AddReference("Ans.UI.Toolkit")
clr.AddReference("Ans.UI.Toolkit.Base")
import Ansys.UI.Toolkit
def click(task):
Ansys.UI.Toolkit.MessageBox.Show("Empty Test!")
def update(task):
ExtAPI.Log.WriteMessage('empty update')
214
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
215
Examples
<parameter name="Input" caption="Input" usage="Input" control="Double" version="1"/>
<parameter name="Output" caption="Output" usage="Output" control="Double" version="1"/>
</parameters>
</task>
</tasks>
<taskgroups>
<taskgroup name="Squares" caption="Squares" icon="squares" category="ACT Custom Workflows"
abbreviation="SQRS" version="1">
<includeTask name="Squares" caption="Squares"/>
</taskgroup>
</taskgroups>
</workflow>
</extension>
IronPython Script
The IronPython script (Squares.py) performs the following actions:
Obtains the parameters.
Prepares the inputs.
Writes the input file.
Runs the external solver.
Reads the output file.
Sets the parameters to the calculated solver values.
Since the XML extension definition file has <onupdate> callback, the update method is defined in
the script. All ACT workflow callbacks get a container (for the task) and a context.
The file, Squares.py, contains the following code:
import System
import clr
clr.AddReference("Ans.Utilities")
import Ansys.Utilities
#convenience method to look up parameters based on a predetermined ID
def GetParameterByName(parameters, id):
match = None
for param in parameters:
if param.ParameterName == id:
match = param
break
return match
def update(task):
container = task.InternalObject
context = ExtAPI.DataModel.Context
activeDir = container.GetActiveDirectory()
extensionDir = ExtAPI.ExtensionManager.CurrentExtension.InstallDir
exeName = "ExampleAddinExternalSolver.exe"
solverPath = System.IO.Path.Combine(extensionDir, exeName)
#get parameters owned by container
params = None
lock = context.ContainerReadLock(container)
params = context.Project.GetDataReferencesByType(container, "ParameterAdapter")
lock.Dispose()
#isolate specific parameters
216
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
217
Examples
via RSM for remote job execution. Once the job has completed, Workbench merges the job back into
the active session and retrieves results. The custom task defined in our extension then updates the
custom property values to the externally-computed square value.
This example also illustrates progress and project reporting functionality.
Figure 87: Data Squares Taskgroup Schematic View
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
The following callbacks reference methods in the IronPython script. The first three callbacks invoke
standard task actions; the rest invoke actions related to the RSM job specification.
<onupdate>
Invokes the update method. Called when the user updates the task.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
219
Examples
<onstatus>
Invokes the status method. Called when the application (e.g. Workbench) asks the task for its current
state.
<onreport>
Invokes the report method. Called when the user generates a project report. This allows the extension
to access the report object and add their own task-specific reporting content.
<oncreatejobinput>
Invokes the createJobInput method. Called when the RSM job requires the generation of all specified
input files. Must prepare and generate the input files specified for the RSM job.
As a method argument, ACT passes in the fully qualified input file paths. For our example, we must
only generate one input file that contains the input value for our squares solver. We can retrieve
the first entry from the input file list, open the file, write our input value line, and close the file. ACT
requires no further action.
<onjobstatus>
Invokes the getJobStatus method. Must tell Workbench if the job has finished. Polled by Workbench
several times during the RSM job execution to determine if the update execution has completed. ACT
supplies the fully qualified output file list as a method argument.
For our example, we will return True when we detect the presence of the solver's sole output file.
Otherwise, we return False.
<onjobcancellation>
Invokes the cancelJob method. Called when the user stops the remote update before the job completes.
Must conduct any clean-up actions required due to a user-initiated stoppage. ACT supplies the fully qualified lists of both input and output files as method arguments.
For our example, we need not perform any action as we require only file cleanup; setting the DeleteFiles attribute to True will automatically handle the file cleanup.
<onjobreconnect>
Invokes the reconnectJob method. Called when the job status reports a completed job. Must retrieve
remotely-solved information from output files and update the task's data, rendering it up-to-date.
For our example, we must read the solver's generated output file and update the output property
that we defined on our task.
For information on the methods invoked, see IronPython Script (p. 220).
IronPython Script
The IronPython script (dataquares_complete.py) defines methods which are invoked by the callbacks in the XML definition file. The update, status, and report methods are standard methods
defined for the task. The createJobInput, getJobStatus, cancelJob, and reconnectJob
methods are related to the RSM job specification.
The file, dataquares_complete.py, contains the following code:
def update(task):
container = task.InternalObject
context = ExtAPI.DataModel.Context
activeDir = container.GetActiveDirectory()
extensionDir = ExtAPI.ExtensionManager.CurrentExtension.InstallDir
220
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
221
Examples
222
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
3. To specify that your task should be executed remotely, set the Update Option property to Submit to Remote Solve Manager.
Additional Solution Process properties become available.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
223
Examples
Figure 89: RSM-Specific Properties for the Data Squares Example
4. Set your Solution Process properties, save, and Update your project.
The task will submit its process to RSM as a new job. Once RSM accepts the job, the task will transition
to the Pending state.
Figure 90: Data Squares Taskgroup in the Pending State
5. To view the status of your RSM job while it is being updated, open the Remote Solve Manager application.
224
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Note
To run your jobs locally in the background, set your Update Option property to Run in
Background. Updates will be treated in a similar manner to true remote updates. Workbench
will prepare the update and invoke the same callbacks as in our example, but the update
will proceed as a separate local update instead of engaging RSM.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
225
Examples
Figure 92: Material Transfer Example Engineering Data View
Figure 94: Custom Taskgroup with Custom Task Passing Material Data to External Task
226
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
IronPython Script
The IronPython script (generic_material_transfer.py) contains the IronPython code that
provides instructions for passing the MatML-formatted material data to a downstream Engineering
Data taskgroup or task. This includes the update method (called by the <onupdate> callback in the
XML extension definition file), which accesses the SampleMaterials.xml file.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
227
Examples
The file, generic_material_transfer.py, contains the following code:
def update(task):
container = task.InternalObject
extensionDir = ExtAPI.ExtensionManager.CurrentExtension.InstallDir
matFilePath = System.IO.Path.Combine(extensionDir, "Sample_Materials.xml")
matFileRef = None
isRegistered = IsFileRegistered(FilePath=matFilePath)
if isRegistered == True:
matFileRef = GetRegisteredFile(matFilePath)
else:
matFileRef = RegisterFile(FilePath=matFilePath)
AssociateFileWithContainer(matFileRef, container)
outputRefs = container.GetOutputData()
matOutputSet = outputRefs["MatML31"]
matOutput = matOutputSet[0]
matOutput.TransferFile = matFileRef
Material File
This file (Sample_Materials.xml), accessed by the IronPython update method, contains the
MatML-formatted material data:
<?xml version="1.0" encoding="UTF-8"?>
<EngineeringData version="17.1">
<Notes />
<Materials>
<MatML_Doc>
<Material>
<BulkDetails>
<Name>Sample Material</Name>
<Description>Sample material from Driver</Description>
<PropertyData property="pr0">
<Data format="string">-</Data>
<ParameterValue parameter="pa0" format="float">
<Data>494.1474492,912.7972764,1172.453938,1941.495468,2803.754154,3869.063522,5245.395513,
10378.82012,18192.58268,28438.67868,57755.1982,94951.87682,135751.6191,178064.7612,216504.4272,261538.9311,
304701.5076,333300.2826,364061.2544,397079.5705,432533.1159,457543.8578,483751.5301</Data>
<Qualifier name="Variable Type">Dependent,Dependent,Dependent,Dependent,Dependent,Dependent,
Dependent,Dependent,Dependent,Dependent,Dependent,Dependent,Dependent,Dependent,Dependent,Dependent,Dependent,
Dependent,Dependent,Dependent,Dependent,Dependent,Dependent</Qualifier>
</ParameterValue>
<ParameterValue parameter="pa1" format="float">
<Data>0.1338,0.2675,0.3567,0.6242,0.8917,1.1592,1.4268,2.051,2.586,3.0318,3.7898,4.3694,4.8153,
5.172,5.4395,5.707,5.9299,6.0637,6.1975,6.3312,6.465,6.5541,6.6433</Data>
<Qualifier name="Variable Type">Independent,Independent,Independent,Independent,Independent,
Independent,Independent,Independent,Independent,Independent,Independent,Independent,Independent,
Independent,Independent,Independent,Independent,Independent,Independent,Independent,Independent,
Independent,Independent</Qualifier>
</ParameterValue>
</PropertyData>
<PropertyData property="prDriver">
<Data format="string">-</Data>
<Qualifier name="Data Link Version">1</Qualifier>
<Qualifier name="Model Type">Linear;Isotropic</Qualifier>
<Qualifier name="Sample Property">Value</Qualifier>
</PropertyData>
</BulkDetails>
</Material>
<Metadata>
<ParameterDetails id="pa0">
<Name>Stress</Name>
<Units>
<Unit>
<Name>Pa</Name>
</Unit>
</Units>
</ParameterDetails>
<ParameterDetails id="pa1">
<Name>Strain</Name>
228
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
229
Examples
Figure 95: End-to-End Mesh Transfer in Custom Taskgroup with both External and Custom Tasks
Figure 96: Custom Taskgroup with Consuming and Providing Connections to External Taskgroups
Figure 97: Custom Taskgroup with Consuming and Providing Connections between Custom task
and External Tasks
230
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
231
Examples
<includeTask
<includeTask
<includeTask
<includeTask
<includeTask
</taskgroup>
</taskgroups>
</workflow>
</extension>
IronPython Script
The IronPython script (generic_mesh_transfer.py) contains the IronPython code that provides
instructions for passing the mesh data to the downstream taskgroup or task.
The file, generic_mesh_transfer.py, contains the following code:
import clr
clr.AddReference("Ans.UI.Toolkit")
clr.AddReference("Ans.UI.Toolkit.Base")
import Ansys.UI.Toolkit
def update(task):
container = task.InternalObject
ExtAPI.Log.WriteMessage('in generic_mesh_transfer.py update method')
#obtain input data
upstreamData = container.GetInputDataByType(InputType="MeshingMesh")
meshFileRef = None
upstreamDataCount = upstreamData.Count
if upstreamDataCount > 0:
meshFileRef = upstreamData[0]
#set our output so that we are just a pass through.
outputRefs = container.GetOutputData()
meshOutputSet = outputRefs["SimulationGeneratedMesh"]
meshOutput = meshOutputSet[0]
#meshOutput.MeshFile = meshFileRef
meshOutput.TransferFile = meshFileRef
ExtAPI.Log.WriteMessage(str(meshFileRef))
#if no new data...nothing to process from upstream sources.
def edit(task):
Ansys.UI.Toolkit.MessageBox.Show("Test!")
Custom Transfer
This custom Workbench workflow example implements a custom transfer from a producing taskgroup
to a consuming taskgroup, creating connections between custom tasks (no ANSYS installed products).
It also illustrates the creation of single-task vs. multi-task task groups.
232
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
The XML extension definition file (CustomTransfer.xml) performs the following actions:
References the IronPython script customtransfer.py.
Defines two tasks in the <tasks> block: Producer and Consumer.
Defines three taskgroups in the <taskgroups> block: Producer, Consumer, and CompleteTransfer.
The Producer and Consumer taskgroups each contain a single task. The CompleteTransfer taskgroup
contains two tasks.
The file, CustomTransfer.xml, contains the following code:
<extension version="1" name="CustomTransfer">
<guid shortid="CustomTransfer">69d0095b-e138-4841-a13a-de12238c83f3</guid>
<script src="customtransfer.py" />
<interface context="Project">
<images>images</images>
</interface>
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
233
Examples
<workflow name="wf4" context="Project" version="1">
<tasks>
<task name="Producer" caption="Producer" icon="test_component" version="1">
<callbacks>
<onupdate>producer_update</onupdate>
</callbacks>
<inputs>
<input/>
</inputs>
<outputs>
<output format="" type="MyData"/>
</outputs>
</task>
<task name="Consumer" caption="consumer" icon="test_component" version="1">
<callbacks>
<onupdate>consumer_update</onupdate>
</callbacks>
<inputs>
<input/>
<input format="" type="MyData"/>
</inputs>
<outputs/>
</task>
</tasks>
<taskgroups>
<taskgroup name="Producer" caption="Producer" icon="producer_system"
category="ACT Custom Workflows" abbreviation="Producer" version="1">
<includeTask name="Producer" caption="Producer"/>
</taskgroup>
<taskgroup name="Consumer" caption="Consumer" icon="consumer_system"
category="ACT Custom Workflows" abbreviation="Consumer" version="1">
<includeTask name="Consumer" caption="Consumer"/>
</taskgroup>
<taskgroup name="CompleteTransfer" caption="CompleteTransfer" icon="consumer_system"
category="ACT Custom Workflows" abbreviation="CompleteTransfer" version="1">
<includeTask name="Producer" caption="Producer"/>
<includeTask name="Consumer" caption="Consumer"/>
</taskgroup>
</taskgroups>
</workflow>
</extension>
IronPython Script
The IronPython script (customtransfer.py) contains the Python code that provides update instructions for the producing taskgroup and for the consuming task to obtain the output data from the upstream producer.
The file, customtransfer.py, contains the following code:
def consumer_update(task):
container = task.InternalObject
#obtain input data
upstreamData = container.GetInputDataByType(InputType="MyData")
fileRef = None
upstreamDataCount = upstreamData.Count
if upstreamDataCount > 0:
fileRef = upstreamData[0]
AssociateFileWithContainer(fileRef, container)
ExtAPI.Log.WriteMessage("Recieved file "+fileRef.Location+" from producer.")
#if no new data...nothing to process from upstream sources.
def producer_update(task):
container = task.InternalObject
extensionDir = ExtAPI.ExtensionManager.CurrentExtension.InstallDir
filePath = System.IO.Path.Combine(extensionDir, "Sample_Materials.xml")
fileRef = None
isRegistered = IsFileRegistered(FilePath=filePath)
if isRegistered == True:
fileRef = GetRegisteredFile(filePath)
else:
234
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Parametric
The following custom Workbench workflow example illustrates the creation of a parametric taskgroup
using the isparametricgroup attribute. When this attribute is set to true , it indicates that that
the taskgroup operates only on design points. As such, the taskgroup is added below the Parameter
Set bar. The focus on parameters in this example enables you to incorporate DesignXplorer-like functionality.
Figure 100: Parametric Example Schematic View
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
235
Examples
<outputs/>
</task>
</tasks>
<taskgroups>
<taskgroup name="Parametric" caption="Parametric" icon="parametric"
category="ACT Custom Workflows" abbreviation="PARAMS" isparametricgroup="True" version="1">
<includeTask name="Parametric" caption="Parametric"/>
</taskgroup>
</taskgroups>
</workflow>
</extension>
IronPython Script
The IronPython script (parametric.py) performs an update on the parameters. Since the XML extension definition file has <onupdate> callback, the update method is defined in the script.
The file, parametric.py, contains the following code:
def update(task):
ExtAPI.Log.WriteMessage("test")
Wizard Examples
In this section, we'll provide examples for each type of simulation wizard.
The following examples are provided:
Project Wizard (Workbench Project Tab)*
Project Wizard (AIM Project Tab)
DesignModeler Wizard*
Mechanical Wizard*
Mixed Wizard*
Electronics Desktop Wizard
SpaceClaim Wizard
AIM Custom Template (Single-Step)
AIM Custom Template (Multiple-Step)
Wizard Custom Layout Example
Note
The wizard examples marked above with an asterisk are all defined in the same extension,
WizardDemos. All other examples are defined in separate extensions.
Note
The wizard examples marked above with an asterisk are all defined in the same extension,
WizardDemos. All other examples are defined in separate extensions.
236
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
237
Examples
For the Geometry step, the <onupdate> callback executes the CreateGeometry action, creating
the geometry upon update; the <onreset> callback executes the DeleteGeometry action, removing the geometry when the Back button is clicked.
For the Mechanical step, the <onupdate> callback executes the CreateMechanical action
and the <onreset> callback executes the DeleteMechanical action.
For the Fluent step, the <onupdate> callback executes the CreateFluent action.
For the ReportView step, the <onrefresh> and <onreset> callbacks execute the RefreshReport and EmptyReset actions.
For the CustomStep, the <onrefresh>, <onupdate>, and <onreset> callbacks execute the
RefreshMechanical, LogReport, and EmptyReset actions
For the Charts step, the <onrefresh> callback executes the RefreshCharts action.
The <propertygroup> blocks define properties and property attributes for the steps. For properties
requiring validation, the <onvalidate> callback executes an appropriate Python validation function.
<extension version="2" minorversion="1" name="WizardDemos">
<guid>6D33EFFC-C521-4859-8273-BA320044B6B8</guid>
<author>ANSYS Inc.</author>
<description>Simple extension to test wizards in different contexts.</description>
<script src="main.py" />
<script src="ds.py" />
<script src="dm.py" />
<interface context="Project|Mechanical">
<images>images</images>
</interface>
...
<wizard name="ProjectWizard" version="1" context="Project" icon="wizard_icon">
<description>Simple wizard for demonstration in Project page.</description>
<step name="Geometry" caption="Geometry" version="1" HelpFile="help/geometry.html">
<description>Create a geometry component.</description>
<callbacks>
<onupdate>CreateGeometry</onupdate>
<onreset>DeleteGeometry</onreset>
</callbacks>
<propertygroup display="caption" name="definition" caption="Basic properties" >
<property name="filename" caption="Geometry file name" control="fileopen" />
<property name="myint" caption="Integer value" control="integer" />
<property name="mytext" caption="Text value" control="text" />
<property name="myquantity" caption="Quantity value" control="float" unit="Pressure" />
<property name="myreadonly" caption="Readonly value" control="text" readonly="true"
default="My value" />
<propertygroup display="property" name="myselect" caption="List of choice" control="select"
default="Option1">
<attributes options="Option1,Option2" />
<property name="option1" caption="Option1 value" control="text" visibleon="Option1" />
<property name="option2first" caption="Option2 first value" control="float" unit="Pressure"
visibleon="Option2" />
<property name="option2seond" caption="Option2 second value" control="float" unit="Length"
visibleon="Option2" />
</propertygroup>
</propertygroup>
</step>
238
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
<step name="Mechanical" caption="Mechanical" enabled="true" version="1" HelpFile="help/mechanical.html">
<description>Create a mechanical component.</description>
<callbacks>
<onupdate>CreateMechanical</onupdate>
<onreset>DeleteMechanical</onreset>
</callbacks>
<property name="name" caption="System name" control="text" />
<propertytable name="table" caption="TabularData" display="worksheet" control="applycancel"
class="Worksheet.PropertyGroupEditor.PGEditor">
<property name="Temperature" caption="Temperature" unit="Temperature" control="float"></property>
<property name="Pressure" caption="Pressure" unit="Pressure" control="float"></property>
</propertytable>
</step>
<step name="Fluent" caption="Fluent" version="1" HelpFile="help/fluent.html">
<description>Create a fluent component.</description>
<callbacks>
<onrefresh>CreateDialog</onrefresh>
<onupdate>CreateFluent</onupdate>
<onreset>EmptyReset</onreset>
</callbacks>
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
239
Examples
<callbacks>
<onrefresh>RefreshCharts</onrefresh>
</callbacks>
</step>
</wizard>
IronPython Script
Below is the IronPython script, main.py.
This script defines all the functions executed by the callbacks in our XML extension file. Each step defined
in the XML file may include multiple actions.
geoSystem = None
dsSystem = None
fluentSystem = None
def CreateGeometry(step):
global geoSystem
template1 = GetTemplate(TemplateName="Geometry")
geoSystem = template1.CreateSystem()
geometry1 = geoSystem.GetContainer(ComponentName="Geometry")
geometry1.SetFile(FilePath=step.Properties["definition/filename"].Value)
def DeleteGeometry(step):
global geoSystem
geoSystem.Delete()
def RefreshMechanical(step):
tree = step.UserInterface.GetPanel("Tree")
root = tree.CreateTreeNode("Root")
node1 = tree.CreateTreeNode("Node1")
node2 = tree.CreateTreeNode("Node2")
node3 = tree.CreateTreeNode("Node3")
root.Values.Add(node1)
root.Values.Add(node2)
node2.Values.Add(node1)
node2.Values.Add(node3)
root.Values.Add(node3)
tree.SetTreeRoot(root)
chart = step.UserInterface.GetPanel("Chart")
chart.Plot([1,2,3,4,5],[10,4,12,13,8],"b","Line1")
chart.Plot([1,2,3,4,5],[5,12,7,8,11],"r","Line2")
def CreateMechanical(step):
global dsSystem, geoSystem
template2 = GetTemplate(
TemplateName="Static Structural",
Solver="ANSYS")
geometryComponent1 = geoSystem.GetComponent(Name="Geometry")
dsSystem = template2.CreateSystem(
ComponentsToShare=[geometryComponent1],
Position="Right",
RelativeTo=geoSystem)
if step.Properties["name"].Value=="error":
raise UserErrorMessageException("Invalid system name. Please try again.")
dsSystem.DisplayText = step.Properties["name"].Value
def DeleteMechanical(step):
global dsSystem
dsSystem.Delete()
def CreateFluent(step):
global dsSystem, fluentSystem
template3 = GetTemplate(TemplateName="Fluid Flow")
geometryComponent2 = dsSystem.GetComponent(Name="Geometry")
solutionComponent1 = dsSystem.GetComponent(Name="Solution")
componentTemplate1 = GetComponentTemplate(Name="CFDPostTemplate")
240
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
fluentSystem = template3.CreateSystem(
ComponentsToShare=[geometryComponent2],
DataTransferFrom=[Set(FromComponent=solutionComponent1, TransferName=None,
ToComponentTemplate=componentTemplate1)],
Position="Right",
RelativeTo=dsSystem)
if step.Properties["name"].Value=="error":
raise Exception("Invalid system name. Please try again.")
fluentSystem.DisplayText = step.Properties["name"].Value
def CreateDialog(step):
dlg = step.UserInterface.Container.CreateDialog("MyDialog", "okCancelDialog", "MyTitle", 400, 150)
dlg.SetOkButton("Ok")
prop = step.Properties["nextstep"]
prop.Options.Clear()
s = step.NextStep
val = s.Caption
while s!=None:
prop.Options.Add(s.Caption)
s = s.NextStep
prop.Value = val
def cbDialog(sender, args):
sender.Container.HideDialog(sender)
def ValidateDialog(step, prop):
dialog = step.UserInterface.GetPanel("MyDialog")
dialog.SetMessage("My own message")
dialog.SetCallback(cbDialog)
dialog.Refresh()
step.UserInterface.Container.ShowDialog(dialog)
def worker(step):
progress = step.UserInterface.GetPanel("Progress")
stopped = progress.UpdateProgress("Start progress...", 0, True)
step.UserInterface.Container.ShowDialog(progress)
for i in range(100):
System.Threading.Thread.Sleep(100)
stopped = progress.UpdateProgress("Start progress...", i+1, True)
if stopped:
break
step.UserInterface.Container.HideDialog(progress)
def ValidateDialogProgress(step, prop):
thread = System.Threading.Thread(System.Threading.ParameterizedThreadStart(worker))
thread.Start(step)
def ValidateNextStep(step, prop):
prop = step.Properties["nextstep"]
s = step.NextStep
v = False
while s!=None:
if prop.Value==s.Caption:
v = True
s.IsEnabled = v
s = s.NextStep
steps = step.UserInterface.GetPanel("Steps")
steps.UpdateData()
steps.Refresh()
def RefreshReport(step):
report = step.UserInterface.GetPanel("Report")
report.SetFilename(System.IO.Path.Combine(ExtAPI.Extension.InstallDir,"help","report.html"))
report.Refresh()
def EmptyReset(step):
pass
def LogReport(step):
ExtAPI.Log.WriteMessage("Report:")
for s in step.Wizard.Steps.Values:
ExtAPI.Log.WriteMessage("Step "+s.Caption)
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
241
Examples
for prop in s.AllProperties:
ExtAPI.Log.WriteMessage(prop.Caption+": "+prop.DisplayString)
import random
import math
def RefreshCharts(step):
graph = step.UserInterface.GetPanel("Graph")
graph.Title("Line Bar Graph")
graph.ShowLegend(False)
graph.Plot([-1, 0, 1, 2, 3, 4], [0.5, -0.5, 0.5, -0.5, 0.5, 0.5], key="Variable A", color='g')
graph.Bar([-1, 0, 1, 2, 3, 4], [10, 20, 30, 10, 5, 20], key="Variable B")
graphB = step.UserInterface.GetPanel("GraphB")
graphB.Title("Plot Graph")
graphB.YTickFormat("0.2f")
xValues = []
yValues = []
for i in range(0, 100):
xValues.append(i)
yValues.append(abs(math.sin(i*0.2))*i/100.0)
graphB.Plot(xValues, yValues, key="y = a*sin(bx)", color="c")
graphB.Plot(xValues, yValues, key="y = x", color="m")
xValues = []
yValues = []
for i in range(0, 100):
xValues.append(i)
yValues.append(i/100.0)
graphB.Plot(xValues, yValues, key="y = x", color="m")
graphB.Plot([0, 10, 20, 30, 100], [0.2, 0.2, 0.2, 0.3, 0.3], key="Smth", color="r")
graphB.Plot([0, 10, 20, 30, 100], [0.2, 0.1, 0.3, 0.5, 0.7], key="Smth", color="r")
graphB.Plot([0, 10, 20, 30, 100], [0.2, 0.2, 0.2, 0.3, 0.3])
graphC = step.UserInterface.GetPanel("GraphC")
graphC.Title("Pie Graph")
graphC.Pie([1, 2, 3])
graphC.Pie([20, 30, 5, 15, 12], [0, "Banana", 2, 3, "42"])
graphD = step.UserInterface.GetPanel("GraphD")
graphD.Title("Bar Graph")
graphD.Bar(["Banana"], [70], key="key")
graphD.Bar([0, "Banana", 2, 3, 4], [20, 30, 5, 15, 12], key="key")
graphE = step.UserInterface.GetPanel("GraphE")
graphE.Title("Bubble Graph")
graphE.XTickFormat("f")
graphE.YTickFormat("f")
keys = ["one", "two", "three", "four", "five"]
colors = ["#BB3333", "#33BB33", "#3333BB", "#BBBB33", "#BB33BB"]
for c in range(0, 5):
xValues = []
yValues = []
sizeValues = []
for i in range(0, (c+1)*20):
rad = random.randrange(c+1, c+2) + (random.random()*2-1)
angle = random.random() * 2 * math.pi
xValues.append(math.cos(angle) * rad)
yValues.append(math.sin(angle) * rad)
sizeValues.append(random.random() * 2.0 + 0.5)
graphE.Bubble(xValues, yValues, sizeValues, key=keys[c], color=colors[c])
242
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
This example calculates the maximum velocity and pressure loss for a CFD system with one inlet and
three outlets.
Note
The XML syntax used to define a project wizard run in AIM is the same as that used to define
a project wizard run in Workbench.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
243
Examples
The name, version, and caption attributes define the step name, version, and display text for the
step.
The context attribute is set to the context in which the specific step is executed. Since this wizard is
run from the AIM Project page, the context is set to Project.
The HelpFile attribute references the HTML help file to be displayed for the step. In this example, the
help provided for each step indicates where each property is displayed in the Study interface.
The <callbacks> block defines the callbacks to the functions defined in the Python script.
For Step1, the <onupdate> callback executes the importGeometry action. This step creates the
CFD workflow, importing and then generating the specified geometry.
The geometry is generated when the user clicks the Next button.
For Step2, the <onupdate> callback executes the refineMesh action. This step allows the user
to specify the mesh resolution and then refines the mesh accordingly.
The refinement is performed when the user clicks the Next button.
For Step3, the <onrefresh> callback executes the initLocations action and the <onupdate>
callback executes the setup action. This step enables the user to specify the loads applied to the
inlet and outlet, selecting a location and specifying a load (Velocity for the Inlet and Gauge
Pressure for the Outlet).
The <isvalid> callback on the OutletLocation property executes the isValid action,
validating the value selected for the outlet location.
For Step4, no callbacks are required. This step takes the value calculated for the CalculatedMaximum
property and populates it to the Calculated maximum field of the Velocity object.
For each step, the <property> blocks define properties and property attributes for the steps. The
<propertygroup> blocks create groupings of properties within the steps.
<extension version="1" name="PressureLoss" icon="images\loss.png">
<guid>D689A1A2-6183-4928-AAE8-8FC3822A66A3</guid>
<author>ANSYS Inc.</author>
<description>Demonstration of a pressure loss in AIM.</description>
<script src="pressureLoss.py" />
<interface context="Project">
<images>images</images>
</interface>
<wizard name="PressureLoss" version="1" context="Project" icon="loss">
<description>This wizard is for demonstration of ACT wizard capability in AIM.</description>
<step name="Step1" caption="Import the geometry" version="1" context="Project"
HelpFile="help/geometry.html">
<description>Import the geometry file and create the workflow.</description>
<callbacks>
<onupdate>importGeometry</onupdate>
</callbacks>
<property name="geometryfile" caption="geometry file" control="fileopen"
default="E:\Geometry\TubeSelectionSet.agdb"/>
</step>
<step name="Step2" caption="Refine the mesh" version="1" context="Project"
244
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
HelpFile="help/mesh.html">
<description>Refine the mesh from Low to High.</description>
<callbacks>
<onupdate>refineMesh</onupdate>
</callbacks>
<property name="MeshResolution" caption="mesh resolution" control="integer" default="1"/>
</step>
<step name="Step3" caption="Define the loads" version="1" context="Project"
HelpFile="help/loads.html">
<description>Specify the loads to applied on the geometry.</description>
<callbacks>
<onrefresh>initLocations</onrefresh>
<onupdate>setup</onupdate>
</callbacks>
<propertygroup name="Inlet" caption="Inlet">
<property name="Velocity" caption="Velocity" control="float" unit="Velocity"
default="0.1 [m s^-1]"/>
<property name="InletLocation" caption="InletLocation" control="select" />
</propertygroup>
<propertygroup name="Outlet" caption="Outlet">
<property name="GaugePressure" caption="Gauge Pressure" control="float" unit="Pressure"
default="0 [Pa]"/>
<property name="OutletLocation" caption="OutletLocation" control="select" >
<callbacks>
<isvalid >isValid</isvalid>
</callbacks>
</property>
</propertygroup>
</step>
<step name="Step4" caption="Export the maximum velocity" version="1" context="Project"
HelpFile="help/result.html">
<description>Here we are just exposing the value of the maximum velocity and the pressure loss.
</description>
<property name="MaximumVelocity" caption="Maximum Velocity" control="float" unit="Velocity"
readonly = "True"/>
<property name="PressureLoss" caption="Pressure Loss" control="float" unit="Pressure"
readonly = "True"/>
</step>
</wizard>
</extension>
IronPython Script
Below is the IronPython script, pressureLoss.py.
This script defines all the functions executed by the callbacks in our XML extension file. Each step defined
in the XML file may include multiple actions.
meshingComponent1 = None
study1 = None
physicsDefinitionComponent1 = None
resultsEvaluationComponent1 = None
solvePhysicsComponent1 = None
physicsRegion1 = None
vectorResult1 = None
singleValueResult1 = None
results1 = None
materialAssignment1 = None
currentStep = None
clr.AddReference("Ans.UI")
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
245
Examples
def getSelectionSetsForProject():
context = __scriptingEngine__.CommandContext
project = context.Project
containers = project.GetContainers()
dataEntity = "SelectionSet"
for container in containers:
if container.Name == "Study":
try:
lockObject = context.ContainerReadLock(container)
dataReferences = project.GetDataReferencesByType(container, dataEntity)
finally:
lockObject.Dispose()
break
return dataReferences
def initLocations(step):
list = getSelectionSetsForProject()
propIn = step.Properties["Inlet/InletLocation"]
propIn.Options.Clear()
propOut = step.Properties["Outlet/OutletLocation"]
propOut.Options.Clear()
for sel in list:
ExtAPI.Log.WriteMessage("OPTION: "+sel.DisplayText)
propIn.Options.Add(sel.DisplayText)
propOut.Options.Add(sel.DisplayText)
comp = step.UserInterface.GetComponent("Properties")
comp.UpdateData()
comp.Refresh()
def isValid(step, property):
if property.Value == step.Properties["Inlet/InletLocation"].Value:
ExtAPI.Log.WriteWarning("Inlet and Outlet locations must be different.")
return False
return True
def importGeometry(step):
global meshingComponent1, study1, results1, vectorResult1, singleValueResult1,
physicsDefinitionComponent1, resultsEvaluationComponent1, solvePhysicsComponent1, physicsRegion1,
materialAssignment1
with Transaction():
system1 = GetSystem(Name="Study")
physicsDefinitionComponent1 = Study.CreateTask( Type="Physics Definition", System=system1)
study1 = system1.GetContainer(ComponentName="Study")
physicsDefinition1 = physicsDefinitionComponent1.GetTaskObject()
physicsRegion1 = study1.CreateEntity( Type="PhysicsRegion", Association=physicsDefinition1)
solverSettings1 = study1.CreateEntity( Type="SolverSettings", Association=physicsDefinition1)
solvePhysicsComponent1 = Study.CreateTask( Type="Solve Physics", System=system1,
Input=physicsDefinitionComponent1)
solvePhysicsComponent1.Refresh()
resultsEvaluationComponent1 = Study.CreateTask( Type="Results Evaluation", System=system1,
Input=solvePhysicsComponent1)
resultsEvaluationComponent1.Refresh()
physicsDefinition1.CalculationType = "Static"
physicsRegion1.PhysicsType = "Fluid"
physicsRegion1.Location = "AllBodies()"
materialAssignment1 = study1.CreateEntity( Type="MaterialAssignment",
Association=physicsDefinition1)
material1 = study1.CreateEntity( Type="Material", Association=physicsDefinition1)
material1.ImportEngineeringData(Name="Air")
materialAssignment1.Material = material1
materialAssignment1.Location = [physicsRegion1]
results1 = resultsEvaluationComponent1.GetTaskObject()
vectorResult1 = study1.CreateEntity( Type="VectorResult", Association=results1)
vectorResult1.Variable = "Velocity"
vectorResult1.DisplayText = "Velocity"
transcript1 = study1.CreateEntity( Type="Transcript", Association=physicsDefinition1)
transcript1.DisplayText = "Fluid Flow Output 1"
physicsSolutionGroup1 = Study.CreateGroup(Name="Physics Solution")
physicsSolutionGroup1.Add(Component=physicsDefinitionComponent1)
246
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
physicsSolutionGroup1.Add(Component=solvePhysicsComponent1)
meshingComponent1 = Study.CreateTask( Type="Meshing", System=system1,
Output=physicsDefinitionComponent1)
physicsDefinitionComponent1.Refresh()
solvePhysicsComponent1.Refresh()
resultsEvaluationComponent1.Refresh()
importComponent1 = Study.CreateTask( Type="Import", System=system1, Output=meshingComponent1)
meshingComponent1.Refresh()
physicsDefinitionComponent1.Refresh()
solvePhysicsComponent1.Refresh()
resultsEvaluationComponent1.Refresh()
import1 = importComponent1.GetTaskObject()
geometryImportSource1 = import1.AddGeometryImportSourceOperation()
geometryImportSource1.FilePath = step.Properties["geometryfile"].Value
importComponent1.Update(AllDependencies=True)
meshingComponent1.Refresh()
physicsDefinitionComponent1.Refresh()
solvePhysicsComponent1.Refresh()
resultsEvaluationComponent1.Refresh()
def refineMesh(step):
global meshingComponent1, study1, results1, vectorResult1, physicsDefinitionComponent1,
singleValueResult1, resultsEvaluationComponent1, solvePhysicsComponent1, physicsRegion1
meshing1 = meshingComponent1.GetTaskObject()
meshing1.MeshResolution = step.Properties["MeshResolution"].Value
def setup(step):
global meshingComponent1, study1, results1, vectorResult1, physicsDefinitionComponent1,
singleValueResult1, resultsEvaluationComponent1, solvePhysicsComponent1, physicsRegion1
with Transaction():
meshing1 = meshingComponent1.GetTaskObject()
meshControlLocalInflation1 = study1.CreateEntity( Type="MeshControlLocalInflation",
Association=meshing1)
meshing1.EngineeringIntent = "FluidFlow"
AddSourceToComponentInSystem( SourceComponent=physicsDefinitionComponent1,
TargetComponent=resultsEvaluationComponent1)
resultsEvaluationComponent1.Refresh()
#meshControlLocalInflation1.Location = ["FACE8", "FACE2", "FACE6"]
Study.Delete(Items=[meshControlLocalInflation1])
with Transaction():
meshingComponent1.Update(AllDependencies=True)
physicsDefinitionComponent1.Refresh()
solvePhysicsComponent1.Refresh()
resultsEvaluationComponent1.Refresh()
with Transaction():
inletBoundary1 = study1.CreateEntity( Type="InletBoundary", Association=physicsRegion1)
inlet_location = step.Properties["Inlet/InletLocation"].Value
ExtAPI.Log.WriteMessage("my inlet location property value is : " + inlet_location)
inlet_selection_set = None
selection_sets = getSelectionSetsForProject()
for selection_set in selection_sets:
if selection_set.DisplayText == inlet_location:
inlet_selection_set = selection_set
if inlet_selection_set == None :
ExtAPI.Log.WriteMessage("inlet selection set does not exist")
inletBoundary1.Location = [inlet_selection_set]
inletBoundary1.Flow.Velocity.Magnitude = step.Properties["Inlet/Velocity"].DisplayString
outletBoundary1 = study1.CreateEntity( Type="OutletBoundary", Association=physicsRegion1)
outlet_location = step.Properties["Outlet/OutletLocation"].Value
outlet_selection_set = None
selection_sets = getSelectionSetsForProject()
for selection_set in selection_sets:
if selection_set.DisplayText == outlet_location:
outlet_selection_set = selection_set
if outlet_selection_set == None :
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
247
Examples
ExtAPI.Log.WriteMessage("outlets selection set does not exist")
outletBoundary1.Location = [outlet_selection_set]
outletBoundary1.Flow.Pressure.GaugeStaticPressure = step.Properties["Outlet/GaugePressure"].
DisplayString
wallBoundary1 = study1.CreateEntity( Type="WallBoundary", Association=physicsRegion1)
# Creation of the pressure loss expression.
singleValueResult1 = study1.CreateEntity( Type="SingleValueResult", Association=results1)
singleValueResult1.Method = "UserDefinedExpressionMethod"
singleValueResult1.Expression = "Average(Pressure, GetBoundary('@Inlet 1'), Weight='Area') Average(Pressure, GetBoundary('@Outlet 1'), Weight='Area')"
with Transaction():
physicsDefinitionComponent1.Update(AllDependencies=True)
solvePhysicsComponent1.Update(AllDependencies=True)
resultsEvaluationComponent1.Refresh()
resultsEvaluationComponent1.Refresh()
resultsEvaluationComponent1.Update(AllDependencies=True)
vectorResult1.Legend.Coloring = "Banded"
vectorResult1.Legend.NumberOfColors = "10"
vectorResult1.Distribution = "Mesh"
vectorResult1.Evaluate()
maximum_velocity = vectorResult1.Summary.Max
step.NextStep.Properties["MaximumVelocity"].Value = maximum_velocity.ToString()
step.NextStep.Properties["PressureLoss"].Value = singleValueResult1.Value.ToString()
def solve(step):
global meshingComponent1, study1, results1, vectorResult1, physicsDefinitionComponent1,
singleValueResult1, resultsEvaluationComponent1, solvePhysicsComponent1, physicsRegion1
with Transaction():
physicsDefinitionComponent1.Update(AllDependencies=True)
solvePhysicsComponent1.Update(AllDependencies=True)
resultsEvaluationComponent1.Refresh()
resultsEvaluationComponent1.Refresh()
resultsEvaluationComponent1.Update(AllDependencies=True)
vectorResult1.Legend.Coloring = "Banded"
vectorResult1.Legend.NumberOfColors = "10"
vectorResult1.Distribution = "Mesh"
vectorResult1.Evaluate()
maximum_velocity = vectorResult1.Summary.Max
step.NextStep.Properties["MaximumVelocity"].Value = maximum_velocity.ToString()
step.NextStep.Properties["PressureLoss"].Value = singleValueResult1.Value.ToString()
248
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
Figure 101: Final Page of PressureLoss Project Wizard
Open the Results task to view the final results obtained by the wizard-driven simulation.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
249
Examples
Figure 102: AIM Study for PressureLoss Project Wizard
On the Study tab, you can see that the wizard created the workflow in AIM and then automatically
executed the steps.
Figure 103: AIM Results for PressureLoss Project Wizard
250
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
DesignModeler Wizard*
Our DesignModeler target-application wizard is called CreateBridge. It is defined in the extension
WizardDemos.
This is a two-step wizard that builds a bridge.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
251
Examples
For the Deck step, the <onupdate> callback executes the UpdateDeck function to create the deck
geometry using the Deck feature.
For the Supports step, the <onupdate> callback executes the UpdateSupports function to
create the bridge supports using the Support geometry.
The <propertygroup> block defines geometry properties and their attributes.
<extension version="2" minorversion="1" name="WizardDemos">
<guid>6D33EFFC-C521-4859-8273-BA320044B6B8</guid>
<author>ANSYS Inc.</author>
<description>Simple extension to test wizards in different contexts.</description>
<script src="main.py" />
<script src="ds.py" />
<script src="dm.py" />
...
<interface context="DesignModeler">
<images>images</images>
<toolbar name="Deck" caption="Deck">
<entry name="Deck" icon="deck">
<callbacks>
<onclick>CreateDeck</onclick>
</callbacks>
</entry>
<entry name="Support" icon="Support">
<callbacks>
<onclick>CreateSupport</onclick>
</callbacks>
</entry>
</toolbar>
</interface>
<simdata context="DesignModeler">
<geometry name="Deck" caption="Deck" icon="deck" version="1">
<callbacks>
<ongenerate>GenerateDeck</ongenerate>
</callbacks>
<property name="Length" caption="Length" control="float" unit="Length" default="300 [m]" />
<property name="Width" caption="Width" control="float" unit="Length" default="20 [m]" />
<property name="Beams" caption="Beams" control="integer" default="31" />
</geometry>
</simdata>
<simdata context="DesignModeler">
<geometry name="Support" caption="Support" icon="support" version="1">
<callbacks>
<ongenerate>GenerateSupport</ongenerate>
</callbacks>
<property name="Length" caption="Length" control="float" unit="Length" default="300 [m]" />
<property name="Height" caption="Height" control="float" unit="Length" default="100 [m]" />
<property name="Width" caption="Width" control="float" unit="Length" default="20 [m]" />
<property name="Number" caption="Number" control="integer" default="3" />
</geometry>
</simdata>
...
<wizard name="CreateBridge" version="1" context="DesignModeler" icon="wizard_icon">
<description>Simple wizard for demonstration in DesignModeler.</description>
<step name="Deck" caption="Deck" version="1" HelpFile="help/dm1.html">
<description>Create the deck.</description>
<callbacks>
<onupdate>UpdateDeck</onupdate>
252
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
</callbacks>
<propertygroup display="caption" name="Deck" caption="Deck Definition" >
<property name="Length" caption="Length" control="float" unit="Length" default="300 [m]" />
<property name="Width" caption="Width" control="float" unit="Length" default="20 [m]" />
<property name="Beams" caption="Beams" control="integer" default="31" />
</propertygroup>
</step>
<step name="Supports" caption="Supports" enabled="true" version="1" HelpFile="help/dm2.html">
<description>Create supports.</description>
<callbacks>
<onupdate>UpdateSupports</onupdate>
</callbacks>
<propertygroup display="caption" name="Supports" caption="Supports Definition" >
<property name="Height" caption="Height" control="float" unit="Length" default="100 [m]" />
<property name="Number" caption="Number" control="integer" default="3" />
</propertygroup>
</step>
</wizard>
IronPython Script
Below is the IronPython script, dm.py.
This script defines all the functions executed by the callbacks in our XML extension file. Each step defined
in the XML file may include multiple actions.
import units
def CreateDeck(ag):
ExtAPI.CreateFeature("Deck")
def CreateSupport(ag):
ExtAPI.CreateFeature("Support")
def GenerateDeck(feature,fct):
length = feature.Properties["Length"].Value
length = units.ConvertUnit(length, ExtAPI.DataModel.CurrentUnitFromQuantityName("Length"), "m")
width = feature.Properties["Width"].Value
width = units.ConvertUnit(width, ExtAPI.DataModel.CurrentUnitFromQuantityName("Length"), "m")
num = feature.Properties["Beams"].Value
builder = ExtAPI.DataModel.GeometryBuilder
bodies = []
boxGen = builder.Primitives.Solid.CreateBox([0.,-width/2.,-0.3],[length,width/2.,0.])
bodies.Add(boxGen.Generate())
w = (length-0.1*num)/(num-1.)+0.1
for i in range(num-1):
beamGen = builder.Primitives.Solid.CreateBox([i*w,-width/2.,-0.6],[i*w+0.1,width/2.,-0.3])
bodies.Add(beamGen.Generate())
beamGen = builder.Primitives.Solid.CreateBox([length-0.1,-width/2.,-0.6],[length,width/2.,-0.3])
bodies.Add(beamGen.Generate())
beamGen = builder.Primitives.Solid.CreateBox([0.,-width/2.,-1.],[length,-width/2.+0.2,-0.6])
bodies.Add(beamGen.Generate())
beamGen = builder.Primitives.Solid.CreateBox([0.,width/2.-0.2,-1.],[length,width/2.,-0.6])
bodies.Add(beamGen.Generate())
feature.Bodies = bodies
feature.MaterialType = MaterialTypeEnum.Add
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
253
Examples
return True
def GenerateSupport(feature,fct):
length = feature.Properties["Length"].Value
length = units.ConvertUnit(length, ExtAPI.DataModel.CurrentUnitFromQuantityName("Length"), "m")
height = feature.Properties["Height"].Value
height = units.ConvertUnit(height, ExtAPI.DataModel.CurrentUnitFromQuantityName("Length"), "m")
width = feature.Properties["Width"].Value
width = units.ConvertUnit(width, ExtAPI.DataModel.CurrentUnitFromQuantityName("Length"), "m")
num = feature.Properties["Number"].Value
builder = ExtAPI.DataModel.GeometryBuilder
bodies = []
w = (length-2.*num)/(num+1.)+2.
for i in range(num):
beamGen = builder.Primitives.Solid.CreateBox([(i+1)*w,-width/2.,-1.-height],
[(i+1)*w+2.,width/2.,-1.])
bodies.Add(beamGen.Generate())
beamGen = builder.Primitives.Solid.CreateBox([0.,-width/2.,-5.],[2.,width/2.,-1.])
bodies.Add(beamGen.Generate())
beamGen = builder.Primitives.Solid.CreateBox([length-2.,-width/2.,-5.],[length,width/2.,-1.])
bodies.Add(beamGen.Generate())
feature.Bodies = bodies
feature.MaterialType = MaterialTypeEnum.Freeze
return True
def UpdateDeck(step):
deck = ExtAPI.CreateFeature("Deck")
deck.Properties["Length"].Value = step.Properties["Deck/Length"].Value
deck.Properties["Width"].Value = step.Properties["Deck/Width"].Value
deck.Properties["Beams"].Value = step.Properties["Deck/Beams"].Value
ExtAPI.DataModel.FeatureManager.Generate()
def UpdateSupports(step):
supports = ExtAPI.CreateFeature("Support")
supports.Properties["Length"].Value = step.PreviousStep.Properties["Deck/Length"].Value
supports.Properties["Width"].Value = step.PreviousStep.Properties["Deck/Width"].Value+6
supports.Properties["Height"].Value = step.Properties["Supports/Height"].Value
supports.Properties["Number"].Value = step.Properties["Supports/Number"].Value
ExtAPI.DataModel.FeatureManager.Generate()
Mechanical Wizard*
Our Mechanical target-application wizard is called SimpleAnalysis. It is defined in the extension WizardDemos.
It performs a simple analysis on the bridge built by our previous CreateBridge DesignModeler wizard.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
Interface Definition
The <interface> block defines details of the interface.
The context attribute is set to Mechanical because the extension is executed in the Mechanical
application.
The <images> block refers to the extension images folder; the image contained in this folder is displayed
as the icon for the wizard.
Wizard Definition
The wizard and its steps are defined in the <wizard> block.
The required name and version attributes define the wizard name and version.
The context attribute is set to Mechanical because the wizard will be executed in the Mechanical
application.
Step Definitions
The <step> tag is used to define the steps of the wizard. There are three steps: Mesh, Solution, and
Results.
For each step:
The name, version, and caption attributes define the step name, version, and display text for the
step.
The HelpFile attribute references the HTML help file to be displayed for the step.
The <callbacks> block defines the callbacks to the functions defined in the Python script.
For the Mesh step, the <onreset> callback executes the RemoveControls function to clear existing
mesh controls; the <onupdate> callback executes the CreateMeshControls function to create
new mesh controls.
For the Solution step:
The <onrefresh> callback executes the RefreshLoads function to initialize various properties
(number of nodes, number of elements computed in the previous step, etc.).
The <onreset> callback executes the RemoveLoads function to clear loads.
The <onupdate> callback executes the CreateLoads to create new loads, create new results,
and perform the solve.
For the Results step, the <onrefresh> callback executes the RefreshResults function to fill
the property value associated to the result of the computation (Maximum of Total Deformation).
The <propertygroup> blocks define properties and property attributes for the steps. For properties
requiring location selection, the <isvalid> callback executes the IsLocationValid function
to validate the selection. A custom message can be displayed when the entered value fails validation.
<extension version="2" minorversion="1" name="WizardDemos">
<guid>6D33EFFC-C521-4859-8273-BA320044B6B8</guid>
<author>ANSYS Inc.</author>
<description>Simple extension to test wizards in different contexts.</description>
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
255
Examples
<script src="main.py" />
<script src="ds.py" />
<script src="dm.py" />
<interface context="Project|Mechanical">
<images>images</images>
</interface>
...
<wizard name="SimpleAnalysis" version="1" context="Mechanical" icon="wizard_icon">
<description>Simple wizard to illustrate how to setup, solve and analyse results of a simulation
process.</description>
<step name="Mesh" caption="Mesh" version="1" HelpFile="help/ds1.html">
<description>Setup some mesh controls.</description>
<callbacks>
<onreset>RemoveControls</onreset>
<onupdate>CreateMeshControls</onupdate>
</callbacks>
<propertygroup display="caption" name="Sizing" caption="Mesh Sizing" >
<property name="Location" caption="Edge Location" control="geometry_selection">
<attributes selection_filter="edge" />
<callbacks>
<isvalid>IsLocationValid</isvalid>
</callbacks>
</property>
<property name="Ndiv" caption="Divisions" control="integer" />
</propertygroup>
</step>
<step name="Solution" caption="Solution" version="1" HelpFile="help/ds2.html">
<description>Setup loads.</description>
<callbacks>
<onrefresh>RefreshLoads</onrefresh>
<onreset>RemoveLoads</onreset>
<onupdate>CreateLoads</onupdate>
</callbacks>
<propertygroup display="caption" name="Mesh" caption="Mesh Statistics" >
<property name="Nodes" caption="Nodes" control="text" readonly="true" />
<property name="Elements" caption="Elements" control="text" readonly="true" />
</propertygroup>
<propertygroup display="caption" name="FixedSupport" caption="Fixed Support" >
<property name="Location" caption="Face Location" control="geometry_selection">
<attributes selection_filter="face" />
<callbacks>
<isvalid>IsLocationFSValid</isvalid>
</callbacks>
</property>
</propertygroup>
</step>
<step name="Results" caption="Results" version="1" HelpFile="help/ds3.html">
<description>View Results.</description>
<callbacks>
<onrefresh>RefreshResults</onrefresh>
</callbacks>
<property name="Res" caption="Deformation" control="text" readonly="true" />
</step>
</wizard>
256
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
IronPython Script
Below is the IronPython script, ds.py.
This script defines all the functions executed by the callbacks in our XML extension file. Each step defined
in the XML file may include multiple actions.
def IsLocationValid(step, prop):
if prop.Value==None:
return False
if prop.Value.Ids.Count!=1:
prop.StateMessage = "Select only one edge."
return False
return True
def CreateMeshControls(step):
model = ExtAPI.DataModel.Project.Model
mesh = model.Mesh
sizing = mesh.AddSizing()
sel = step.Properties["Sizing/Location"].Value
entity = ExtAPI.DataModel.GeoData.GeoEntityById(sel.Ids[0])
len = entity.Length
ids = []
for part in ExtAPI.DataModel.GeoData.Assemblies[0].Parts:
for body in part.Bodies:
for edge in body.Edges:
if abs(edge.Length-len)/len<1.e-6:
ids.Add(edge.Id)
sel = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)
sel.Ids = ids
sizing.Location = sel
sizing.Type = SizingType.NumberOfDivisions
sizing.NumberOfDivisions = step.Properties["Sizing/Ndiv"].Value
step.Attributes.SetValue("sizing", sizing)
mesh.GenerateMesh()
def RemoveControls(step):
sizing = step.Attributes["sizing"]
sizing.Delete()
def IsLocationFSValid(step, prop):
if prop.Value==None:
return False
if prop.Value.Ids.Count!=1:
prop.StateMessage = "Select only one face."
return False
return True
def RefreshLoads(step):
model = ExtAPI.DataModel.Project.Model
step.Properties["Mesh/Nodes"].Value = model.Mesh.Nodes.ToString()
step.Properties["Mesh/Elements"].Value = model.Mesh.Elements.ToString()
panel = step.UserInterface.GetPanel("Properties")
panel.UpdateData()
panel.Refresh()
def CreateLoads(step):
model = ExtAPI.DataModel.Project.Model
analysis = model.Analyses[0]
support = analysis.AddFixedSupport()
sel = step.Properties["FixedSupport/Location"].Value
entity = ExtAPI.DataModel.GeoData.GeoEntityById(sel.Ids[0])
area = entity.Area
ids = []
for part in ExtAPI.DataModel.GeoData.Assemblies[0].Parts:
for body in part.Bodies:
for face in body.Faces:
if abs(face.Area-area)/area<1.e-6:
ids.Add(face.Id)
sel = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
257
Examples
sel.Ids = ids
support.Location = sel
loads = []
loads.Add(support)
step.Attributes.SetValue("loads", loads)
loads.Add(analysis.AddEarthGravity())
res = analysis.Solution.AddTotalDeformation()
step.Attributes.SetValue("res", res)
loads.Add(res)
analysis.Solve(True)
ExtAPI.Extension.SetAttributeValueWithSync("result", res.Maximum.ToString())
def RemoveLoads(step):
loads = step.Attributes["loads"]
for load in loads:
load.Delete()
def RefreshResults(step):
model = ExtAPI.DataModel.Project.Model
res = step.PreviousStep.Attributes["res"]
step.Properties["Res"].Value = res.Maximum.ToString()
panel = step.UserInterface.GetPanel("Properties")
panel.UpdateData()
panel.Refresh()
Mixed Wizard*
Our mixed wizard example is called BridgeSimulation. It is defined in the extension WizardDemos.
It executes one step on the Project tab, reuses the bridge builder in our CreateBridge DesignModeler
wizard, reruns the bridge analysis in our SimpleAnalysis Mechanical wizard, and then returns to the
Project tab to execute a Results step.
258
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
Wizard Definition
The wizard and its steps are defined in the <wizard> block.
The required name and version attributes define the wizard name and version.
The context attribute is set to Project because the wizard will be executed in the Project tab; it
accesses the target applications from the Project tab instead of executing in them directly.
Step Definitions
The <step> tag is used to define the steps of the wizard. There are six steps: Project, Deck, Supports,
Mesh, Solution, and Results.
For each step:
The name, version, and caption attributes define the step name, version, and display text for the
step.
The HelpFile attribute references the HTML help file to be displayed for the step.
The <callbacks> block defines the callbacks to the functions defined in the Python script.
For the Project step, the <onupdate> callback executes the CreateStaticStructural
function in main.py.
For the Deck and Supports steps, <onupdate> callback executes the UpdateDeck and UpdateSupports functions in dm.py.
For the Mesh step, the <onreset> and <onupdate> callbacks execute the RemoveControls
and CreateMeshControls functions in ds.py.
For the Solution step, the <onrefresh>, <onreset>, and <onupdate> callbacks execute the
RefreshLoads, RemoveLoads, and CreateLoads functions in ds.py.
For the Results step, the <onrefresh> callback executes the RefreshResultsProject
function in main.py.
The <propertygroup> blocks define properties and property attributes for the steps.
<extension version="2" minorversion="1" name="WizardDemos">
<guid>6D33EFFC-C521-4859-8273-BA320044B6B8</guid>
<author>ANSYS Inc.</author>
<description>Simple extension to test wizards in different contexts.</description>
<script src="main.py" />
<script src="ds.py" />
<script src="dm.py" />
<interface context="Project|Mechanical">
<images>images</images>
</interface>
<interface context="DesignModeler">
<images>images</images>
<toolbar name="Deck" caption="Deck">
<entry name="Deck" icon="deck">
<callbacks>
<onclick>CreateDeck</onclick>
</callbacks>
</entry>
<entry name="Support" icon="Support">
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
259
Examples
<callbacks>
<onclick>CreateSupport</onclick>
</callbacks>
</entry>
</toolbar>
</interface>
<simdata context="DesignModeler">
<geometry name="Deck" caption="Deck" icon="deck" version="1">
<callbacks>
<ongenerate>GenerateDeck</ongenerate>
</callbacks>
<property name="Length" caption="Length" control="float" unit="Length" default="300 [m]" />
<property name="Width" caption="Width" control="float" unit="Length" default="20 [m]" />
<property name="Beams" caption="Beams" control="integer" default="31" />
</geometry>
</simdata>
<simdata context="DesignModeler">
<geometry name="Support" caption="Support" icon="support" version="1">
<callbacks>
<ongenerate>GenerateSupport</ongenerate>
</callbacks>
<property name="Length" caption="Length" control="float" unit="Length" default="300 [m]" />
<property name="Height" caption="Height" control="float" unit="Length" default="100 [m]" />
<property name="Width" caption="Width" control="float" unit="Length" default="20 [m]" />
property name="Number" caption="Number" control="integer" default="3" />
</geometry>
</simdata>
<wizard name="ProjectWizard" version="1" context="Project" icon="wizard_icon">
<description>Simple wizard for demonstration in Project page.</description>
<step name="Geometry" caption="Geometry" version="1" HelpFile="help/geometry.html">
<description>Create a geometry component.</description>
<callbacks>
<onupdate>CreateGeometry</onupdate>
<onreset>DeleteGeometry</onreset>
</callbacks>
<propertygroup display="caption" name="definition" caption="Basic properties" >
<property name="filename" caption="Geometry file name" control="fileopen" />
<property name="myint" caption="Integer value" control="integer" />
<property name="mytext" caption="Text value" control="text" />
<property name="myquantity" caption="Quantity value" control="float" unit="Pressure" />
<property name="myreadonly" caption="Readonly value" control="text" readonly="true"
default="My value" />
<propertygroup display="property" name="myselect" caption="List of choice" control="select"
default="Option1">
<attributes options="Option1,Option2" />
<property name="option1" caption="Option1 value" control="text" visibleon="Option1" />
<property name="option2first" caption="Option2 first value" control="float" unit="Pressure"
visibleon="Option2" />
<property name="option2seond" caption="Option2 second value" control="float" unit="Length"
visibleon="Option2" />
</propertygroup>
</propertygroup>
</step>
<step name="Mechanical" caption="Mechanical" enabled="true" version="1" HelpFile="help/mechanical.html">
<description>Create a mechanical component.</description>
<callbacks>
<onupdate>CreateMechanical</onupdate>
<onreset>DeleteMechanical</onreset>
</callbacks>
<property name="name" caption="System name" control="text" />
<propertytable name="table" caption="TabularData" display="worksheet" control="applycancel"
260
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
class="Worksheet.PropertyGroupEditor.PGEditor">
<property name="Temperature" caption="Temperature" unit="Temperature" control="float"></property>
<property name="Pressure" caption="Pressure" unit="Pressure" control="float"></property>
</propertytable>
</step>
<step name="Fluent" caption="Fluent" version="1" HelpFile="help/fluent.html">
<description>Create a fluent component.</description>
<callbacks>
<onrefresh>CreateDialog</onrefresh>
<onupdate>CreateFluent</onupdate>
<onreset>EmptyReset</onreset>
</callbacks>
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
261
Examples
262
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
<callbacks>
<isvalid>IsLocationFSValid</isvalid>
</callbacks>
</property>
</propertygroup>
</step>
<step name="Results" caption="Results" version="1" HelpFile="help/ds3.html">
<description>View Results.</description>
<callbacks>
<onrefresh>RefreshResults</onrefresh>
</callbacks>
<property name="Res" caption="Deformation" control="text" readonly="true" />
</step>
</wizard>
<wizard name="BridgeSimulation" version="1" context="Project" icon="bridge">
<description>Simple wizard for mixed wizard demonstration.</description>
<step name="Project" caption="Create Project" version="1" context="Project" HelpFile="help/prj1.html">
<description>Create a static structural analysis.</description>
<callbacks>
<onupdate>CreateStaticStructural</onupdate>
<onreset>DeleteStaticStructural</onreset>
</callbacks>
<property name="Name" caption="system name" control="text" />
</step>
<step name="Deck" caption="Deck" version="1" context="DesignModeler" HelpFile="help/dm1.html">
<description>Create the deck.</description>
<callbacks>
<onupdate>UpdateDeck</onupdate>
</callbacks>
<propertygroup display="caption" name="Deck" caption="Deck Definition" >
<property name="Length" caption="Length" control="float" unit="Length" default="300 [m]" />
<property name="Width" caption="Width" control="float" unit="Length" default="20 [m]" />
<property name="Beams" caption="Beams" control="integer" default="31" />
</propertygroup>
</step>
<step name="Supports" caption="Supports" context="DesignModeler" enabled="true" version="1"
HelpFile="help/dm2.html">
<description>Create supports.</description>
<callbacks>
<onupdate>UpdateSupports</onupdate>
</callbacks>
<propertygroup display="caption" name="Supports" caption="Supports Definition" >
<property name="Height" caption="Height" control="float" unit="Length" default="100 [m]" />
<property name="Number" caption="Number" control="integer" default="3" />
</propertygroup>
</step>
<step name="Mesh" caption="Mesh" version="1" context="Mechanical" HelpFile="help/ds1.html">
<description>Setup some mesh controls.</description>
<callbacks>
<onreset>RemoveControls</onreset>
<onupdate>CreateMeshControls</onupdate>
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
263
Examples
</callbacks>
<propertygroup display="caption" name="Sizing" caption="Mesh Sizing" >
<property name="Location" caption="Edge Location" control="geometry_selection">
<attributes selection_filter="edge" />
<callbacks>
<isvalid>IsLocationValid</isvalid>
</callbacks>
</property>
<property name="Ndiv" caption="Divisions" control="integer" />
</propertygroup>
</step>
<step name="Solution" caption="Solution" version="1" context="Mechanical" HelpFile="help/ds2.html">
<description>Setup loads.</description>
<callbacks>
<onrefresh>RefreshLoads</onrefresh>
<onreset>RemoveLoads</onreset>
<onupdate>CreateLoads</onupdate>
</callbacks>
<propertygroup display="caption" name="Mesh" caption="Mesh Statistics" >
<property name="Nodes" caption="Nodes" control="text" readonly="true" />
<property name="Elements" caption="Elements" control="text" readonly="true" />
</propertygroup>
<propertygroup display="caption" name="FixedSupport" caption="Fixed Support" >
<property name="Location" caption="Face Location" control="geometry_selection">
<attributes selection_filter="face" />
<callbacks>
<isvalid>IsLocationFSValid</isvalid>
</callbacks>
</property>
</propertygroup>
</step>
<step name="Results" caption="Results" version="1" context="Project" HelpFile="help/prj2.html">
<description>View Results.</description>
<callbacks>
<onrefresh>RefreshResultsProject</onrefresh>
</callbacks>
<property name="Res" caption="Deformation" control="text" readonly="true" />
</step>
</wizard>
</extension>
IronPython Script
Because this is a mixed wizard incorporating steps on the Project tab with steps from our existing
DesignModeler and Mechanical wizards, the XML file references the three script files shown in previous
sections:
main.py
dm.py
ds.py
264
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
265
Examples
The <callbacks> block defines the callbacks to the functions defined in the callbacks.py Python
script. These are discussed in more detail in Reviewing the Analysis (p. 268).
<extension name="Wizard Demo" version="1">
<author>ANSYS Inc.</author>
<guid>819d1fd2-17c2-493a-ad6a-ee608356229a</guid>
<script src="callbacks.py" />
<interface context="ElectronicsDesktop">
<images>images</images>
</interface>
<wizard name="ED Wizard Demo" caption="Electronics Desktop Wizard Demo" version="1"
context="ElectronicsDesktop" icon="antImage">
<description>Simple example of a wizard in Electronics Desktop</description>
<step name="Step1" version="1" caption="Design">
<description>Create geometry</description>
<propertygroup name="dim" caption="Dimensions (mm)" persistent="False" parameterizable="False">
<property control="float" name="width" caption="Width" persistent="False"
parameterizable="False" default="0.4" />
<property control="float" name="height" caption="Height" persistent="False"
parameterizable="False" default="1.7" />
</propertygroup>
<propertygroup name="offset" caption="Offset for duplication (mm)" persistent="False"
parameterizable="False">
<property control="float" name="offset" caption="Offset" persistent="False"
parameterizable="False" default="0.3" />
</propertygroup>
<callbacks>
<onupdate>OnUpdate1</onupdate>
<onreset>OnReset1</onreset>
</callbacks>
</step>
<step name="Step2" version="1" caption="Setup">
<description>Define boundary conditions</description>
<propertygroup name="bc" caption="Boundary Conditions (Ohm)" persistent="False"
parameterizable="False">
<property control="float" name="resistance" caption="Full Resistance" persistent="False"
parameterizable="False" default="50." />
<property control="float" name="reactance" caption="Full Reactance" persistent="False"
parameterizable="False" default="0." />
</propertygroup>
<callbacks>
<onupdate>OnUpdate2</onupdate>
</callbacks>
</step>
</wizard>
</extension>>
IronPython Script
Below is the IronPython script, callbacks.py.
This script defines all the functions executed by the callbacks in our XML extension file.
# ---------------------------------------------# Callbacks
# ---------------------------------------------oDesign = None
266
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
oProject = None
def OnUpdate1(step):
global oDesign, oProject
oProject = oDesktop.NewProject()
oProject.InsertDesign("HFSS", "HFSSDesign1", "DrivenModal", "")
oDesign = oProject.SetActiveDesign("HFSSDesign1")
oEditor = oDesign.SetActiveEditor("3D Modeler")
width = step.Properties["dim/width"].Value
height = step.Properties["dim/height"].Value
offset = step.Properties["offset/offset"].Value
oEditor.CreateRectangle(
[
"NAME:RectangleParameters",
"IsCovered:="
, True,
"XStart:="
, "0mm",
"YStart:="
, "0mm",
"ZStart:="
, "0mm",
"Width:="
, str(width)+"mm",
"Height:="
, str(height)+"mm",
"WhichAxis:="
, "Z"
],
[
"NAME:Attributes",
"Name:="
, "Rectangle1",
"Flags:="
, "",
"Color:="
, "(128 255 255)",
"Transparency:="
, 0.800000011920929,
"PartCoordinateSystem:=", "Global",
"UDMId:="
, "",
"MaterialValue:="
, "\"vacuum\"",
"SolveInside:="
, True
])
oEditor.DuplicateAlongLine(
[
"NAME:Selections",
"Selections:="
, "Rectangle1",
"NewPartsModelFlag:="
, "Model"
],
[
"NAME:DuplicateToAlongLineParameters",
"CreateNewObjects:="
, True,
"XComponent:="
, "0mm",
"YComponent:="
, str(height+offset)+"mm",
"ZComponent:="
, "0mm",
"NumClones:="
, "2"
],
[
"NAME:Options",
"DuplicateAssignments:=", False
])
def OnReset1(step):
global oProject
oDesktop.CloseProject(oProject.GetName())
def OnUpdate2(step):
global oDesign
oModule = oDesign.GetModule("BoundarySetup")
width = step.PreviousStep.Properties["dim/width"].Value
height = step.PreviousStep.Properties["dim/height"].Value
offset = step.PreviousStep.Properties["offset/offset"].Value
resistance = step.Properties["bc/resistance"].Value
reactance = step.Properties["bc/reactance"].Value
oModule.AssignPerfectE(
[
"NAME:PerfE1",
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
267
Examples
"Objects:="
, ["Rectangle1_1","Rectangle1"],
"InfGroundPlane:=" , False
])
oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.CreateRectangle(
[
"NAME:RectangleParameters",
"IsCovered:="
, True,
"XStart:="
, "0mm",
"YStart:="
, str(height)+"mm",
"ZStart:="
, "0mm",
"Width:="
, str(width)+"mm",
"Height:="
, str(offset)+"mm",
"WhichAxis:="
, "Z"
],
[
"NAME:Attributes",
"Name:="
, "Rectangle2",
"Flags:="
, "",
"Color:="
, "(128 255 255)",
"Transparency:="
, 0.800000011920929,
"PartCoordinateSystem:=", "Global",
"UDMId:="
, "",
"MaterialValue:="
, "\"vacuum\"",
"SolveInside:="
, True
])
oModule.AssignLumpedPort(
[
"NAME:1",
"Objects:="
, ["Rectangle2"],
"RenormalizeAllTerminals:=", True,
"DoDeembed:="
, False,
[
"NAME:Modes",
[
"NAME:Mode1",
"ModeNum:="
, 1,
"UseIntLine:="
, True,
[
"NAME:IntLine",
"Start:="
, [str(width/2.)+"mm",str(height)+"mm","0mm"],
"End:="
, [str(width/2.)+"mm",str(height+offset)+"mm","0mm"]
],
"AlignmentGroup:=" , 0,
"CharImp:="
, "Zpi",
"RenormImp:="
, "50ohm"
]
],
"ShowReporterFilter:=" , False,
"ReporterFilter:=" , [True],
"FullResistance:=" , str(resistance)+"ohm",
"FullReactance:="
, str(reactance)+"ohm"
])
268
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
Figure 104: The Design Step
In this step:
The two <propertygroup> blocks define the three dimensional properties.
The first block defines the Dimensions to be used in creating the first rectangle: Width and Height
The second block defines the Offset for duplication to be used in the duplication of the first rectangle.
The <callbacks> block defines the following callbacks:
The <onupdate> callback is called when the Next button is clicked and invokes the OnUpdate1 function.
This function creates the new project, creates the first rectangle based on the entered dimensions and
then creates the second rectangle via duplication and offset according to the entered offset value.
The <onreset> callback is called when the user clicks on the Back button on the next step. The Back
button is enabled only if the <onreset> callback has been defined.
Step2 is the Setup step that defines and applies the boundary conditions.
Figure 105: The Setup Step
In this step:
The <propertygroup> block defines the two boundary conditions, the Full Resistance and Full Reactance
properties.
The <callbacks> block defines the <onupdate> callback, which is called when the Next button is
clicked and invokes the OnUpdate2 function. The OnUpdate2 function applies the boundary conditions
to both rectangles.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
269
Examples
Once the wizard has completed, you can view the boundary conditions by selecting them in the Electronics Desktop Project Manager tree.
Figure 106: The Boundary Conditions
SpaceClaim Wizard
Our SpaceClaim wizard example is called BGAWizard. It is defined in the extension SC_BGA_Extension.
270
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
Script Reference
The <script> block specifies the IronPython script referenced by the extension, main.py.
Interface Definition
The <interface> block defines details of the interface.
The context attribute is set to SpaceClaim because the extension is executed in the SpaceClaim
application.
The <toolbar> block is used to define a toolbar and toolbar button for exposure in SpaceClaim.
Wizard Definition
The wizard and its steps are defined in the <wizard> block.
The required name and version attributes define the wizard name and version.
The context attribute is set to SpaceClaim because the wizard is executed in the SpaceClaim application.
Step Definitions
The <step> tag within the <wizard> block is used to define the steps of the wizard. There are three
steps: Die, SubstrateAndSolderMask, and SolderBall.
For each step:
The name, version, and caption attributes define the step name, version, and display text
for the step.
The <callbacks> block defines the callbacks to the functions defined in the main.py Python
script.
For the Die step, the <onupdate> callback executes the GenerateDie function.
For the SubstrateAndSolderMask step, the <onupdate> callback executes the GenerateSubstrateAndSolderMask function.
For the SolderBall step, the <onupdate> callback executes the GenerateBalls function.
The <propertygroup> blocks define properties and property attributes for the steps.
<extension version="1" name="SC_BGA_Extension">
<script src="main.py" />
<guid shortid="SC_BGA_Extension">5107C33A-E123-4F55-8166-2ED2AA59B3B2</guid>
<interface context="SpaceClaim">
<images>images</images>
<callbacks>
<oninit>oninit</oninit>
</callbacks>
<toolbar name="SC_BGA_Extension" caption="SC_BGA Extension">
<entry name="SC_BGA_Package" icon="icepak_package">
<callbacks>
<onclick>createMyFeature</onclick>
</callbacks>
</entry>
</toolbar>
</interface>
<wizard name="BGAWizard" version="1" context="SpaceClaim">
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
271
Examples
<description>BGA Wizard</description>
<step name="Die" caption="Die" version="1">
<callbacks><onupdate>GenerateDie</onupdate></callbacks>
<property name="Thickness" caption="Height" unit="Length" control="float" default="0.3[mm]"/>
<property name="Width"
caption="Width" unit="Length" control="float" default="5 [mm]"/>
</step>
<step name="SubstrateAndSolderMask" caption="Substrate and SolderMask" version="1">
<callbacks><onupdate>GenerateSubstrateAndSolderMask</onupdate></callbacks>
<propertygroup name="SubstrateDetails" caption="SubstrateDetails" display="caption">
<property name="Thickness" caption="Thickness" unit="Length" control="float"
default="0.4 [mm]" >
</property>
<property name="Length" caption="Length" unit="Length" control="float" default="13 [mm]" >
</property>
</propertygroup>
<propertygroup name="SolderMaskDetails" caption="SolderMaskDetails" display="caption">
<property name="Height" caption="Solder Mask Height" unit="Length" control="float"
default="0.05 [mm]"/>
</propertygroup>
</step>
<step name="SolderBall" caption="Solder ball" version="1">
<callbacks><onupdate>GenerateBalls</onupdate></callbacks>
<property name="Face" caption="Face" control="scoping">
<attributes selection_filter="face"/>
</property>
<propertygroup name="SolderBallDetails" caption="Solder Ball Details" display="caption">
<propertygroup display="property" name="BallsPrimitive" caption="Balls primitive" control="select"
default="sphere">
<attributes options="sphere,cylinder,cone,cube,gear"/>
</propertygroup>
<property name="Pitch" caption="Pitch" unit="Length" control="float" default="0.8 [mm]"/>
<property name="Radius" caption="Radius" unit="Length" control="float" default="0.35 [mm]"/>
<property name="Number of Solder Ball Columns" caption="No of Solder Ball Columns" control="integer"
default="16"/>
<property name="Number of Solder Ball Rows" caption="No of Solder Ball Rows" control="integer" default="16"/>
</propertygroup>
<propertygroup name="Central Balls" caption="Central Thermal Balls">
<propertygroup display="property" name="Central Thermal Balls" caption="Want to Supress Central Balls"
control="select" default="No">
<attributes options="Yes,No"/>
<property name="Number of Solder Ball Columns" caption="No of Solder Ball Columns" control="integer"
default="4" visible = "false" visibleon="Yes"/>
<property name="Number of Solder Ball Rows" caption="No of Solder Ball Rows" control="integer"
default="4" visible = "false" visibleon="Yes"/>
</propertygroup>
</propertygroup>
</step>
</wizard>
<extension>
IronPython Script
Below is the IronPython script, main.py.
This script defines all the functions executed by the callbacks in our XML extension file. Each step defined
in the XML file may include multiple actions.
import
import
import
import
import
272
System
clr
sys
os
math
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
part = None
def oninit(context):
return
def createMyFeature(ag):
ExtAPI.CreateFeature("MyFeature1")
def createSphere(x, y, z, radius):
global part
from System.Collections.Generic import List
# get selected part
if part==None:
win = Window.ActiveWindow
context = win.ActiveContext
part = context.ActivePart.Master
center = Geometry.Point.Create(x, y, z)
profileFrame = Geometry.Frame.Create(center, Geometry.Direction.DirX, Geometry.Direction.DirY)
sphereCircle = Geometry.Circle.Create(profileFrame, radius)
sphereRevolveLine = Geometry.Line.Create(center, Geometry.Direction.DirX)
profile = List[Geometry.ITrimmedCurve]()
profile.Add(Geometry.CurveSegment.Create(sphereCircle, Geometry.Interval.Create(0, math.pi)));
profile.Add(Geometry.CurveSegment.Create(sphereRevolveLine, Geometry.Interval.Create(-radius,
radius)))
path = List[Geometry.ITrimmedCurve]()
sweepCircle = Geometry.Circle.Create(Geometry.Frame.Create(center, Geometry.Direction.DirY,
Geometry.Direction.DirZ), radius)
path.Add(Geometry.CurveSegment.Create(sweepCircle))
body = Modeler.Body.SweepProfile(Geometry.Profile(Geometry.Plane.Create(profileFrame), profile), path)
DesignBody.Create(part, "sphere", body)
def createCylinder(x, y, z, radius, h):
global part
from System.Collections.Generic import List
# get selected part
if part==None:
win = Window.ActiveWindow
context = win.ActiveContext
part = context.ActivePart.Master
defaultPointUV = Geometry.PointUV.Create(0, 0)
profile = Geometry.CircleProfile(Geometry.Plane.PlaneXY, radius, defaultPointUV, 0)
points = List[Geometry.Point]()
points.Add(Geometry.Point.Create(0, 0, 0))
points.Add(Geometry.Point.Create(0, 0, h))
path = Geometry.PolygonProfile(Geometry.Plane.PlaneXY, points)
body = Modeler.Body.SweepProfile(profile, path.Boundary)
designBody = DesignBody.Create(part, "Cylinder", body)
translation = Geometry.Matrix.CreateTranslation(Geometry.Vector.Create(x, y, z))
designBody.Transform(translation)
def createCone(x, y, z, radius, h):
global part
from System.Collections.Generic import List
# get selected part
if part==None:
win = Window.ActiveWindow
context = win.ActiveContext
part = context.ActivePart.Master
defaultPointUV = Geometry.PointUV.Create(0, 0)
path = Geometry.CircleProfile(Geometry.Plane.PlaneXY, radius, defaultPointUV, 0)
points = List[Geometry.Point]()
points.Add(Geometry.Point.Create(0, 0, 0))
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
273
Examples
points.Add(Geometry.Point.Create(radius, 0, h))
points.Add(Geometry.Point.Create(0, 0, h))
triangle = Geometry.PolygonProfile(Geometry.Plane.PlaneZX, points)
body = Modeler.Body.SweepProfile(triangle, path.Boundary)
designBody = DesignBody.Create(part, "Cone", body)
translation = Geometry.Matrix.CreateTranslation(Geometry.Vector.Create(x, y, z))
designBody.Transform(translation)
def createBox(xa, ya, za, xb, yb, zb):
global part
# get selected part
if part==None:
win = Window.ActiveWindow
context = win.ActiveContext
part = context.ActivePart.Master
lengthX
lengthY
lengthZ
xa = xa
ya = ya
=
=
=
+
+
xb - xa
yb - ya
zb - za
lengthX * 0.5
lengthY * 0.5
p = Geometry.PointUV.Create(0, 0)
body = Modeler.Body.ExtrudeProfile(Geometry.RectangleProfile(Geometry.Plane.PlaneXY, lengthX,
lengthY, p, 0), lengthZ)
designBody = DesignBody.Create(part, "body", body)
translation = Geometry.Matrix.CreateTranslation(Geometry.Vector.Create(xa, ya, za))
designBody.Transform(translation)
def createGear(x, y, z, innerRadius, outerRadius, width, count, holeRadius):
global part
from System.Collections.Generic import List
# get selected part
if part==None:
win = Window.ActiveWindow
context = win.ActiveContext
part = context.ActivePart.Master
frame = Geometry.Frame.World
# create gear
outsideCircle = Geometry.Circle.Create(frame, outerRadius);
insideCircle = Geometry.Circle.Create(frame, innerRadius);
boundary = List[Geometry.ITrimmedCurve]()
inwardLine = Geometry.Line.Create(frame.Origin, -frame.DirX);
outwardLine = Geometry.Line.Create(frame.Origin, frame.DirX);
axis = outsideCircle.Axis;
nTeeth = count;
repeatAngle = 2 * math.pi / nTeeth;
toothAngle = 0.6 * repeatAngle;
gapAngle = repeatAngle - toothAngle;
for i in range(0, nTeeth):
# an arc is just a parameter interval of a circle
startTooth = i * repeatAngle;
endTooth = startTooth + toothAngle;
boundary.Add(Geometry.CurveSegment.Create(outsideCircle, Geometry.Interval.Create(startTooth,
endTooth)));
# rotate 'inwardLine' about the circle axis
rotatedInwardLine = Geometry.Matrix.CreateRotation(axis, endTooth) * inwardLine;
# a line segment is just a parameter interval of an unbounded line
boundary.Add(Geometry.CurveSegment.Create(rotatedInwardLine, Geometry.Interval.Create(-outerRadius,
-innerRadius)));
startGap = endTooth;
endGap = startGap + gapAngle;
274
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
boundary.Add(Geometry.CurveSegment.Create(insideCircle, Geometry.Interval.Create(startGap, endGap)));
rotatedOutwardLine = Geometry.Matrix.CreateRotation(axis, endGap) * outwardLine;
boundary.Add(Geometry.CurveSegment.Create(rotatedOutwardLine, Geometry.Interval.Create(innerRadius,
outerRadius)));
hole = Geometry.Circle.Create(frame.Create(frame.Origin, frame.DirX, frame.DirY), holeRadius);
boundary.Add(Geometry.CurveSegment.Create(hole));
body = Modeler.Body.ExtrudeProfile(Geometry.Profile(Geometry.Plane.Create(frame), boundary), width);
pieces = body.SeparatePieces().GetEnumerator()
while pieces.MoveNext():
designBody = DesignBody.Create(part, "GearBody", pieces.Current);
translation = Geometry.Matrix.CreateTranslation(Geometry.Vector.Create(x, y, z))
designBody.Transform(translation)
class Vector:
def __init__(self, x = 0, y = 0, z = 0):
self.x = x
self.y = y
self.z = z
def Clone(self):
return Vector(self.x, self.y, self.z)
def NormSQ(self):
return self.x*self.x + self.y*self.y + self.z*self.z
def Norm(self):
return math.sqrt(self.x*self.x + self.y*self.y + self.z*self.z)
def Normalize(self):
norm = self.Norm()
self.x = self.x / norm
self.y = self.y / norm
self.z = self.z / norm
def GetNormalize(self):
norm = self.Norm(self)
return Vector(self.x / norm, self.y / norm, self.z / norm)
def __add__(va, vb):
return Vector(va.x + vb.x, va.y + vb.y, va.z + vb.z)
def __sub__(va, vb):
return Vector(va.x - vb.x, va.y - vb.y, va.z - vb.z)
def __mul__(v, x):
return Vector(v.x*x, v.y*x, v.z*x)
def Cross(va, vb):
return Vector(va.y*vb.z - va.z*vb.z, -va.z*vb.x + va.x*vb.z, va.x*vb.y - va.y*vb.x)
def Dot(va, vb):
return va.x*vb.x + va.y*vb.y + va.z*vb.z
def ToString(self):
return "( " + str(self.x) + ", " + str(self.y) + ", " + str(self.z) + " )"
def CreateBalls(primitive, pitch, radius, column, row, supr, columnSupr, rowSupr, center, dirColumn, dirRow):
dirColumn.Normalize()
dirRow.Normalize()
startVector = center - dirColumn*column*pitch*0.5 - dirRow*row*pitch*0.5
startVector = startVector + dirColumn*radius + dirRow*radius
startVector = startVector + dirRow.Cross(dirColumn)*radius
stepVectorColumn = dirColumn * pitch
stepVectorRow
= dirRow * pitch
if(supr == "Yes"):
column_index_to_start_supress = int( column * 0.5 - columnSupr * 0.5 )
row_index_to_start_supress
= int( row
* 0.5 - rowSupr
* 0.5 )
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
275
Examples
v = startVector.Clone()
for i in range(column):
for j in range(row):
createBall = False
if (supr == "Yes" and
(i
i
j
j
<
>=
<
>=
column_index_to_start_supress or
column_index_to_start_supress + columnSupr or
row_index_to_start_supress or
row_index_to_start_supress+ rowSupr)
or supr == "No"):
if primitive == "sphere":
createSphere(v.x, v.y, v.z, radius)
elif primitive == "cylinder":
createCylinder(v.x, v.y, v.z, radius, radius * 2.)
elif primitive == "cone":
createCone(v.x, v.y, v.z, radius, radius * 2.)
elif primitive == "cube":
createBox(v.x - radius, v.y - radius, v.z - radius,
v.x + radius, v.y + radius, v.z + radius)
elif primitive == "gear":
createGear(v.x, v.y, v.z,
radius*0.5, radius, radius*2, 10, radius*0.2)
v = v + stepVectorRow
v = startVector.Clone()
startVector = startVector + stepVectorColumn
v = v + stepVectorColumn
def CreateDie(width, thickness, zStart):
createBox(-0.5 * width, -0.5 * width, zStart,
0.5 * width, 0.5 * width, zStart + thickness)
def CreateSubstrate(width, thickness, zStart):
createBox(-0.5 * width, -0.5 * width, zStart,
0.5 * width, 0.5 * width, zStart + thickness)
def CreateSolderMask(width, thickness, zStart):
createBox(-0.5 * width, -0.5 * width, zStart,
0.5 * width, 0.5 * width, zStart + thickness)
def generateBGAGeometry(feature,fct):
ps = feature.Properties
Pitch
Solder_Ball_Radius
No_Of_Solder_Ball_Column
No_Of_Solder_Ball_Row
No_Of_Solder_Ball_Column_Supress
Ball Columns"].Value
No_Of_Solder_Ball_Row_Supress
Ball Rows"].Value
Substrate_Thickness
Substrate_Width
Die_Thickness
Die_Width
Solder_Mask_Height
supress_balls
ballsPrimitive
=
=
=
=
=
bodies = []
CreateBalls(ballsPrimitive, Pitch, Solder_Ball_Radius, No_Of_Solder_Ball_Column, No_Of_Solder_Ball_Row,
supress_balls,
No_Of_Solder_Ball_Column_Supress, No_Of_Solder_Ball_Row_Supress,
Vector(0, 0, 0), Vector(1, 0, 0), Vector(0, 1, 0))
#Creating Substrate and soldermask
CreateSubstrate(Substrate_Width, Substrate_Thickness, 0)
CreateSolderMask(Substrate_Width, Solder_Mask_Height, 0)
#Creating Die
Die_Start = Substrate_Thickness
276
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
CreateDie(Die_Width, Die_Thickness, Die_Start)
return True
def GenerateDie(step):
global part
win = Window.ActiveWindow
context = win.ActiveContext
part = context.ActivePart
ps = step.Properties
Die_Thickness = ps["Thickness"].Value
Die_Width
= ps["Width"].Value
CreateDie(Die_Width, Die_Thickness, 0)
part = None
def GenerateSubstrateAndSolderMask(step):
global part
win = Window.ActiveWindow
context = win.ActiveContext
part = context.ActivePart
Die_Thickness = step.PreviousStep.Properties["Thickness"].Value
ps = step.Properties
Substrate_Thickness = ps["SubstrateDetails/Thickness"].Value
Substrate_Width
= ps["SubstrateDetails/Length"].Value
Solder_Mask_Height = ps["SolderMaskDetails/Height"].Value
CreateSubstrate(Substrate_Width, Substrate_Thickness, Die_Thickness)
CreateSolderMask(Substrate_Width, Solder_Mask_Height, Die_Thickness + Substrate_Thickness)
part = None
def GenerateBalls(step):
global part
win = Window.ActiveWindow
context = win.ActiveContext
part = context.ActivePart
zStart
zStart
zStart
zStart
= 0
+= step.PreviousStep.PreviousStep.Properties["Thickness"].Value
+= step.PreviousStep.Properties["SubstrateDetails/Thickness"].Value
+= step.PreviousStep.Properties["SolderMaskDetails/Height"].Value
ps = step.Properties
faces
= ps["Face"].Value.Faces
pitch
= ps["SolderBallDetails/Pitch"].Value
radius
= ps["SolderBallDetails/Radius"].Value
column
= ps["SolderBallDetails/Number of Solder Ball Columns"].Value
row
= ps["SolderBallDetails/Number of Solder Ball Rows"].Value
primitive = ps["SolderBallDetails/BallsPrimitive"].Value
columnSupr = ps["Central Balls/Central Thermal Balls/Number of Solder Ball Columns"].Value
rowSupr
= ps["Central Balls/Central Thermal Balls/Number of Solder Ball Rows"].Value
supr
= ps["Central Balls/Central Thermal Balls"].Value
for i in range(0, faces.Count):
face = faces[i]
edges = face.Edges
if edges.Count == 0:
continue
# find two edges with a common point
edgeA = edges[0]
startPointA = edgeA.Shape.StartPoint
endPointA
= edgeA.Shape.EndPoint
for j in range(1, edges.Count):
edgeB = edges[j]
startPointB = edgeB.Shape.StartPoint
endPointB
= edgeB.Shape.EndPoint
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
277
Examples
if startPointB == startPointA:
basePoint
= startPointB
pointRow
= endPointA
pointColumn = endPointB
elif endPointB == startPointA:
basePoint
= endPointB
pointRow
= endPointA
pointColumn = startPointB
elif startPointB == endPointA:
basePoint
= startPointB
pointRow
= startPointA
pointColumn = endPointB
elif endPointB == endPointA:
basePoint
= endPointB
pointRow
= startPointA
pointColumn = startPointB
if not basePoint is None:
dirColumn = Vector(pointRow.X - basePoint.X, pointRow.Y - basePoint.Y,
pointRow.Z - basePoint.Z)
dirRow
= Vector(pointColumn.X - basePoint.X, pointColumn.Y - basePoint.Y,
pointColumn.Z - basePoint.Z)
center
= Vector(basePoint.X, basePoint.Y, basePoint.Z) + (dirRow + dirColumn)*0.5
CreateBalls(primitive, pitch, radius, column, row, supr, columnSupr, rowSupr, center,
dirColumn, dirRow)
break
part = None
Extension Definition
The extension is defined in the top-level <extension> block.
Extension Details
The required name and version attributes define the extension name and version.
The optional icon attribute specifies the path and filename for the image to be shown for the extension
in the Extension Manager (when accessed via the ACT Start Page). In this example, the icon file is
loss.png in the extensions images folder.
The required guid attribute specifies a unique identifier for the extension.
The optional description attribute provides a description that is shown in the extension details accessed
via the right-click About option in the Extension Manager (when accessed via the ACT Start Page).
Script Definition
The <script> block specifies the IronPython script referenced by the extension. For this custom template,
the script is main.py.
Interface Definition
The extension interface is defined in the <interface> block.
278
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
Because the extension will be run in AIM, the context attribute is set to Study.
The <images> tag references the extensions images folder, which contains the image to be shown
for the extension.
Step Definitions
The <step> tag is used to define the single step of our custom template, step1.
Step Definitions
The required name and version attributes define the extension name and version.
The optional icon attribute specifies the path and filename for the image to be shown for the extension
in the Extension Manager (when accessed via the ACT Start Page).
The optional description attribute provides a description that is shown in the extension details accessed via the right-click About option in the Extension Manager (when accessed via the ACT Start
Page).
The optional helpFile attribute references the HTML help file to be displayed for the step and causes
the extension to search for help files.
For details on the custom help for this specific example, see Defining Custom Help for the SingleStep Custom Template (p. 282).
The <callbacks> block defines the callbacks to the functions defined in the Python script. For an AIM
custom template, only the <onupdate>, <onrefresh>, and <onreset> callbacks are supported.
In this example:
The <onupdate> callback executes the action function, which creates the Study in AIM.
The <onreset> executes the reset function, which allows you to modify the template
properties.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
279
Examples
The <properties> block defines the properties used in the custom template. In this example:
For the Geometry property, the control attribute is set to fileopen, which displays a file-selection
property initialized to the default attribute value.
For the NAnalysis property:
The control attribute is set to integer, which allows you to edit the integer value for the default
attribute. This value specifies the number of analyses to be performed.
The <isvalid> callback calls the isvalid function, which validates that the entered integer is
not less than 1. A custom message can be displayed when the entered value fails validation.
<extension version="1" name="StudyDemo">
<author>ANSYS Inc.</author>
<script src="main.py" />
<interface context="Study">
<images>images</images>
</interface>
<wizard name="StudyDemo1" version="1" context="Study" icon="icon">
<description>Wizard to demonstrate the concept inside AIM.</description>
<step name="Step1" caption="Load geometry file" version="1" context="Study" helpFile="help/Step1.html">
<description>Import a geometry file.</description>
<callbacks>
<onupdate>action</onupdate>
<onreset>reset</onreset>
</callbacks>
<property name="Geometry" caption="Geometry file name" control="fileopen"
default="E:/Models/box.agdb" />
<property name="NAnalysis" caption="Number of Analysis" control="integer" default="1">
<callbacks>
<isvalid>isvalid</isvalid>
</callbacks>
</property>
</step>
</wizard>
</extension>
IronPython Script
Below is the IronPython script, main.py.
This script defines the functions called by the callbacks in the custom template's XML extension definition
file.
The action function is the single step in our custom template. When called by the <onupdate> callback
(invoked by the Create Simulation button), it creates the Study workflow by creating and updating the
Geometry, Mesh, and Physics tasks.
The reset function, when called by the <onreset> callback, resets the UI and allows the user to modify
properties defined for the custom template. This occurs when encountering an error during the execution
of the <onupdate> callback.
280
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
The isvalid function, when called by the <isvalid> callback in the <properties> block, validates
that the property value entered is not less than 1. A custom message can be displayed when the entered
value fails validation.
tasksToDelete = []
groupsToDelete = []
def action(step):
global tasksToDelete,groupsToDelete
tasksToDelete = []
groupsToDelete = []
system1 = GetSystem(Name="Study")
importComponent1 = Study.CreateTask(
Type="Import",
System=system1)
tasksToDelete.Add(importComponent1)
study1 = system1.GetContainer(ComponentName="Study")
import1 = importComponent1.GetTaskObject()
geometryImportSource1 = study1.CreateEntity(
Type="GeometryImportSource",
Association=import1)
geometryImportSource1.FilePath = step.Properties["Geometry"].Value
geometryImportSource1.GenerateImportSourceOperation()
step.UpdateProgressInformation(10.)
pct = 10.
for i in range(step.Properties["NAnalysis"].Value):
meshingComponent1 = Study.CreateTask(
Type="Meshing",
System=system1,
Input=importComponent1)
tasksToDelete.Add(meshingComponent1)
meshingComponent1.Refresh()
physicsSolutionGroup1 = Study.CreateGroup(Name="Physics Solution")
groupsToDelete.Add(physicsSolutionGroup1)
physicsDefinitionComponent1 = Study.CreateTask(
Type="Physics Definition",
System=system1)
tasksToDelete.Add(physicsDefinitionComponent1)
solvePhysicsComponent1 = Study.CreateTask(
Type="Solve Physics",
System=system1)
tasksToDelete.Add(solvePhysicsComponent1)
physicsSolutionGroup1.Add(Component=physicsDefinitionComponent1)
physicsSolutionGroup1.Add(Component=solvePhysicsComponent1)
AddSourceToComponentInSystem(
SourceComponent=physicsDefinitionComponent1,
TargetComponent=solvePhysicsComponent1)
AddSourceToComponentInSystem(
SourceComponent=meshingComponent1,
TargetComponent=physicsDefinitionComponent1)
physicsDefinitionComponent1.Refresh()
solvePhysicsComponent1.Refresh()
physicsDefinition1 = physicsDefinitionComponent1.GetTaskObject()
physicsRegion1 = study1.CreateEntity(
Type="PhysicsRegion",
Association=physicsDefinition1)
solverSettings1 = study1.CreateEntity(
Type="SolverSettings",
Association=physicsDefinition1)
transcript1 = study1.CreateEntity(
Type="Transcript",
Association=physicsDefinition1)
physicsDefinitionComponent1.Refresh()
solvePhysicsComponent1.Refresh()
meshing1 = meshingComponent1.GetTaskObject()
meshing1.EngineeringIntent = "StructuralOrThermalOrElectricConduction"
physicsRegion1.Location = ["BODY1"]
physicsRegion1.PhysicsType = "Structural"
materialAssignment1 = study1.CreateEntity(
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
281
Examples
Type="MaterialAssignment",
Association=physicsDefinition1)
materialAssignment1.Location = ["BODY1"]
material1 = study1.CreateEntity(
Type="Material",
Association=physicsDefinition1)
material1.ImportEngineeringData(Name="Structural Steel")
materialAssignment1.Material = material1
pct += 10.
step.UpdateProgressInformation(pct)
if i==9:
raise UserErrorMessageException("My own error message.")
def reset(step):
global tasksToDelete,groupsToDelete
system1 = GetSystem(Name="Study")
for group in groupsToDelete:
Study.DeleteTaskGroup(Group=group)
for task in tasksToDelete:
task.DeleteTask(System=system1)
def isvalid(step, prop):
if prop.Value<1:
prop.StateMessage = "Must be greater than 0."
return False
return True
The step-level help file is referenced in the XML step definition, as follows:
<step name="Step1" caption="Load geometry file" version="1" context="Study" helpFile="help/Step1.html">
282
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
The property-level help files dont need to be referenced from the XML file; once the helpFile attribute
is used at the step-level, the extension will find and display the help files for the associated properties
within the step.
Extension Definition
The extension is defined in the top-level <extension> block.
Extension Details
The required name and version attributes define the extension name and version.
The optional icon attribute specifies the path and filename for the image to be shown for the extension
in the Extension Manager(when accessed via the ACT Start Page). In this example, the icon file is
loss.png in the extensions images folder.
The required guid attribute specifies a unique identifier for the extension.
The optional description attribute provides a description that is shown in the extension details accessed via the right-click About option in the Extension Manager (when accessed via the ACT Start
Page).
Script Definition
The <script> block specifies the IronPython script referenced by the extension. For this example, the
script is pressureLoss.py.
Interface Definition
The extension interface is defined in the <interface> block.
Because the extension will be run in AIM, the context attribute is set to Study.
The <images> tag references the extensions images folder, which contains the image to be shown
for the extension and the custom template.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
283
Examples
The optional icon attribute specifies the filename for the image to be shown for the custom template
in AIM under Simulation Process Templates. This image must be stored in the extensions images
folder.
The optional description attribute provides a description that is shown in the extension details accessed via the right-click About option in the Extension Manager (when accessed via the ACT Start
Page).
Step Definitions
The <step> tag is used to define the four steps of our custom template: Step1, Step2, Step3, and
Step4. For each step:
The required name and version attributes define the name and version of the step.
The optional description attribute provides a description of the step which is shown for the step in
the custom template UI.
The optional caption attribute specifies the label shown in for the step in the CDV.
The optional helpFile attribute references the HTML help file to be displayed for the step and causes
the extension to search for help files.
For general information on custom template help, see Custom Help for Wizards.
For details on the custom help for this specific example, see Defining Custom Help for the MultipleStep Custom Template (p. 289).
The <callbacks> block defines the callbacks to the functions defined in the Python script. For an AIM
custom template, only the <onupdate>, <onrefresh>, and <onreset> callbacks are supported.
During the execution of an <onupdate> callback for a step, an AIM progress message is displayed,
indicating that the step is being executed.
The <properties> block defines the properties used in the custom template.
Note that property definitions can include callbacks, as in Step 3 of our example. For details, see
the Breakdown of Steps (p. 284).
Breakdown of Steps
Step 1
Imports the geometry and creates the workflow in AIM.
The geometryfile property enables you to specify a geometry. You can either keep the geometry
specified by the default attribute or can browse to select a different one (control=fileopen).
For our example, we select a geometry called TubeSelectionSet.agdb.
The <onupdate> callback is invoked when you click the Next button. It executes the importGeometry
function, which imports the geometry you selected and then creates the workflow in AIM. Specifically,
it creates the workflow from journal content included in the Python function.
The HelpFile attribute references the help file geometry.html.
Step 2
Refines the mesh for the geometry.
284
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
The MeshResolution property enables you to set the resolution for the mesh. The Mesh Resolution
field has a default of 1 (default=1) and accepts only integer values (control= integer).
The <onupdate> callback is invoked when you click the Next button. It executes the refineMesh
function, which creates a mesh according to your specification.
The HelpFile attribute references the help file mesh.html.
Step 3
Defines the loads applied to the geometry.
The Velocity and GaugePressure properties enable you to enter values (control=float).
The InletLocation and OutletLocation properties require you to define the inlet and outlet
locations to which the load will be applied (control=scoping).
When a value is entered in the Outlet Location field, the <isvalid> callback is invoked. It executes
the isValid function, which verifies that the inlet and outlet locations are not the same.
The <onupdate> callback is invoked when you click the Next button. It executes the setup function,
which applies the loads to the selected locations and performs the calculations.
The HelpFile attribute references the help file loads.html.
Step 4
Exposes the maximum velocity and pressure loss results.
The MaximumVelocity and PressureLoss properties show the calculated values in read-only
format (readonly=true).
Click the Finish button to exit the custom template and return to the analysis.
<extension version="1" name="PressureLossMultiple" icon="images\loss.png">
<guid>C3F86496-2F13-49E3-B7D0-353542207EAE</guid>
<author>ANSYS Inc.</author>
<description>Demonstration of a pressure loss in AIM.</description>
<script src="pressureLoss.py" />
<interface context="Project">
<images>images</images>
</interface>
<wizard name="PressureLossMultiple" version="1" context="Study" icon="loss">
<description>This wizard is for demonstration of ACT wizard capability in AIM.</description>
<step name="Step1" caption="Import the geometry" version="1" context="Study"
HelpFile="help/Step1.html">
<description>Import the geometry file and create the workflow.</description>
<callbacks>
<onupdate>importGeometry</onupdate>
</callbacks>
<property name="geometryfile" caption="Geometry File" control="fileopen"
default="E:\Geometry\TubeSelectionSet.agdb"/>
</step>
<step name="Step2" caption="Refine the mesh" version="1" helpFile="help/Step2.html">
<description>Refine the mesh from Low to High.</description>
<callbacks>
<onupdate>refineMesh</onupdate>
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
285
Examples
</callbacks>
<property name="MeshResolution" caption="Mesh Resolution" control="integer" default="1"/>
</step>
<step name="Step3" caption="Define the loads" version="1" helpFile="help/Step3.html">
<description>Specify the loads to applied on the geometry.</description>
<callbacks>
<onupdate>setup</onupdate>
</callbacks>
<!--<propertygroup name="Inlet" caption="Inlet">
<property name="Velocity" caption="Velocity" control="float" unit="Velocity"
default="0.1 [m s^-1]"/>
<property name="InletLocation" caption="InletLocation" control="scoping" />
</propertygroup>
<propertygroup name="Outlet" caption="Outlet">
<property name="GaugePressure" caption="Gauge Pressure" control="float"
unit="Pressure" default="0 [Pa]"/>
<property name="OutletLocation" caption="OutletLocation" control="scoping" >
<callbacks>
<isvalid >isValid</isvalid>
</callbacks>
</property>
</propertygroup>-->
<property name="Velocity" caption="Velocity" control="float" unit="Velocity"
default="0.1 [m s^-1]"/>
<property name="InletLocation" caption="Inlet Location" control="scoping" />
<property name="GaugePressure" caption="Gauge Pressure" control="float"
unit="Pressure" default="0 [Pa]"/>
<property name="OutletLocation" caption="Outlet Location" control="scoping" >
<callbacks>
<isvalid >isValid</isvalid>
</callbacks>
</property>
</step>
<step name="Step4" caption="Export the maximum velocity" version="1" helpFile="help/Step4.html">
<description>Here we are just exposing the value of the maximum velocity and the pressure
loss.</description>
<property name="MaximumVelocity" caption="Maximum Velocity" control="float" unit="Velocity"
readonly = "True"/>
<property name="PressureLoss" caption="Pressure Loss" control="float" unit="Pressure"
readonly = "True"/>
</step>
</wizard>
</extension>
IronPython Script
Below is the IronPython script, pressureLoss.py.
This script defines the functions called by the callbacks in the custom template's XML extension definition
file.
meshingComponent1 = None
study1 = None
import1 = None
physicsDefinitionComponent1 = None
resultsEvaluationComponent1 = None
solvePhysicsComponent1 = None
physicsRegion1 = None
vectorResult1 = None
singleValueResult1 = None
286
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
results1 = None
materialAssignment1 = None
currentStep = None
clr.AddReference("Ans.UI")
def getSelectionSetsForProject():
context = __scriptingEngine__.CommandContext
project = context.Project
containers = project.GetContainers()
dataEntity = "SelectionSet"
for container in containers:
if container.Name == "Study":
try:
lockObject = context.ContainerReadLock(container)
dataReferences = project.GetDataReferencesByType(container, dataEntity)
finally:
lockObject.Dispose()
break
return dataReferences
def isValid(step, property):
if property.Value == step.Properties["InletLocation"].Value:
ExtAPI.Log.WriteWarning("Inlet and Outlet locations must be different.")
return False
return True
def importGeometry(step):
global meshingComponent1, import1, study1, results1, vectorResult1, singleValueResult1,
physicsDefinitionComponent1, resultsEvaluationComponent1, solvePhysicsComponent1, physicsRegion1,
materialAssignment1
with Transaction():
system1 = GetSystem(Name="Study")
physicsDefinitionComponent1 = Study.CreateTask( Type="Physics Definition", System=system1)
study1 = system1.GetContainer(ComponentName="Study")
physicsDefinition1 = physicsDefinitionComponent1.GetTaskObject()
physicsRegion1 = study1.CreateEntity( Type="PhysicsRegion", Association=physicsDefinition1)
solverSettings1 = study1.CreateEntity( Type="SolverSettings", Association=physicsDefinition1)
solvePhysicsComponent1 = Study.CreateTask( Type="Solve Physics", System=system1,
Input=physicsDefinitionComponent1)
solvePhysicsComponent1.Refresh()
resultsEvaluationComponent1 = Study.CreateTask( Type="Results Evaluation", System=system1,
Input=solvePhysicsComponent1)
resultsEvaluationComponent1.Refresh()
physicsDefinition1.CalculationType = "Static"
physicsRegion1.PhysicsType = "Fluid"
physicsRegion1.Location = "AllBodies()"
materialAssignment1 = study1.CreateEntity( Type="MaterialAssignment",
Association=physicsDefinition1)
material1 = study1.CreateEntity( Type="Material", Association=physicsDefinition1)
material1.ImportEngineeringData(Name="Air")
materialAssignment1.Material = material1
materialAssignment1.Location = [physicsRegion1]
results1 = resultsEvaluationComponent1.GetTaskObject()
vectorResult1 = study1.CreateEntity( Type="VectorResult", Association=results1)
vectorResult1.Variable = "Velocity"
vectorResult1.DisplayText = "Velocity"
transcript1 = study1.CreateEntity( Type="Transcript", Association=physicsDefinition1)
transcript1.DisplayText = "Fluid Flow Output 1"
physicsSolutionGroup1 = Study.CreateGroup(Name="Physics Solution")
physicsSolutionGroup1.Add(Component=physicsDefinitionComponent1)
physicsSolutionGroup1.Add(Component=solvePhysicsComponent1)
meshingComponent1 = Study.CreateTask( Type="Meshing", System=system1,
Output=physicsDefinitionComponent1)
physicsDefinitionComponent1.Refresh()
solvePhysicsComponent1.Refresh()
resultsEvaluationComponent1.Refresh()
importComponent1 = Study.CreateTask( Type="Import", System=system1, Output=meshingComponent1)
meshingComponent1.Refresh()
physicsDefinitionComponent1.Refresh()
solvePhysicsComponent1.Refresh()
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
287
Examples
resultsEvaluationComponent1.Refresh()
import1 = importComponent1.GetTaskObject()
geometryImportSource1 = import1.AddGeometryImportSourceOperation()
geometryImportSource1.FilePath = step.Properties["geometryfile"].Value
importComponent1.Update(AllDependencies=True)
meshingComponent1.Refresh()
physicsDefinitionComponent1.Refresh()
solvePhysicsComponent1.Refresh()
resultsEvaluationComponent1.Refresh()
Study.ChangeModelSelectionContextTo(import1)
def refineMesh(step):
global meshingComponent1, import1, study1, results1, vectorResult1, physicsDefinitionComponent1,
singleValueResult1, resultsEvaluationComponent1, solvePhysicsComponent1, physicsRegion1
meshing1 = meshingComponent1.GetTaskObject()
meshing1.MeshResolution = step.Properties["MeshResolution"].Value
Study.ChangeModelSelectionContextTo(import1)
def setup(step):
global meshingComponent1, study1, results1, vectorResult1, physicsDefinitionComponent1,
singleValueResult1, resultsEvaluationComponent1, solvePhysicsComponent1, physicsRegion1
with Transaction():
meshing1 = meshingComponent1.GetTaskObject()
meshControlLocalInflation1 = study1.CreateEntity( Type="MeshControlLocalInflation",
Association=meshing1)
meshing1.EngineeringIntent = "FluidFlow"
AddSourceToComponentInSystem( SourceComponent=physicsDefinitionComponent1,
TargetComponent=resultsEvaluationComponent1)
resultsEvaluationComponent1.Refresh()
Study.Delete(Items=[meshControlLocalInflation1])
with Transaction():
meshingComponent1.Update(AllDependencies=True)
physicsDefinitionComponent1.Refresh()
solvePhysicsComponent1.Refresh()
resultsEvaluationComponent1.Refresh()
with Transaction():
inletBoundary1 = study1.CreateEntity( Type="InletBoundary", Association=physicsRegion1)
inlet_location = step.Properties["InletLocation"].Value.LocationSet
if inlet_location == None :
ExtAPI.Log.WriteMessage("inlet selection set does not exist")
inletBoundary1.Location = inlet_location
inletBoundary1.Flow.Velocity.Magnitude = step.Properties["Velocity"].DisplayString
outletBoundary1 = study1.CreateEntity( Type="OutletBoundary", Association=physicsRegion1)
outlet_location = step.Properties["OutletLocation"].Value.LocationSet
if outlet_location == None :
ExtAPI.Log.WriteMessage("outlets selection set does not exist")
outletBoundary1.Location = outlet_location
outletBoundary1.Flow.Pressure.GaugeStaticPressure = step.Properties["GaugePressure"].DisplayString
wallBoundary1 = study1.CreateEntity( Type="WallBoundary", Association=physicsRegion1)
with Transaction():
physicsDefinitionComponent1.Update(AllDependencies=True)
solvePhysicsComponent1.Update(AllDependencies=True)
resultsEvaluationComponent1.Refresh()
resultsEvaluationComponent1.Refresh()
resultsEvaluationComponent1.Update(AllDependencies=True)
vectorResult1.Legend.Coloring = "Banded"
vectorResult1.Legend.NumberOfColors = "10"
vectorResult1.Distribution = "Mesh"
vectorResult1.Evaluate()
maximum_velocity = vectorResult1.Summary.Max
step.NextStep.Properties["MaximumVelocity"].Value = maximum_velocity.ToString()
288
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
step.NextStep.Properties["PressureLoss"].Value = singleValueResult1.Value.ToString()
def solve(step):
global meshingComponent1, study1, results1, vectorResult1, physicsDefinitionComponent1,
singleValueResult1, resultsEvaluationComponent1, solvePhysicsComponent1, physicsRegion1
with Transaction():
physicsDefinitionComponent1.Update(AllDependencies=True)
solvePhysicsComponent1.Update(AllDependencies=True)
resultsEvaluationComponent1.Refresh()
resultsEvaluationComponent1.Refresh()
resultsEvaluationComponent1.Update(AllDependencies=True)
vectorResult1.Legend.Coloring = "Banded"
vectorResult1.Legend.NumberOfColors = "10"
vectorResult1.Distribution = "Mesh"
vectorResult1.Evaluate()
maximum_velocity = vectorResult1.Summary.Max
step.NextStep.Properties["MaximumVelocity"].Value = maximum_velocity.ToString()
step.NextStep.Properties["PressureLoss"].Value = singleValueResult1.Value.ToString()
The step-level help files are referenced in the XML step definitions. For example:
<step name="Step1" caption="Import the geometry" version="1" context="Study" HelpFile="help/Step1.html">
The property-level help files dont need to be referenced from the XML file; once the helpFile attribute
is used at the step-level, the extension will find and display the help files for the associated properties
within that step.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
289
Examples
Note
Since the basic construction of wizard extension is described elsewhere, in this section well
focus solely on aspects of layout customization.
290
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Wizard Examples
heighttype="Percentage" height="67" widthtype="Percentage" width="30" componenttype="stepsListComponent" />
<component name="TabularData" leftattachment="Steps" leftoffset="0" topattachment="Title"
topoffset="0" rightoffset="10" bottomattachment="Help" bottomoffset="10" heighttype="Percentage"
height="67" widthtype="Percentage"
width="70" componenttype="tabularDataComponent" />
<component name="Help" leftoffset="10" topattachment="TabularData" topoffset="0" rightoffset="10"
bottomattachment="Submit" bottomoffset="10" heighttype="Percentage" height="33" widthtype="Percentage"
width="100"
componenttype="helpContentComponent" />
<component name="Submit" leftoffset="10" topattachment="Help" topoffset="0" rightoffset="10"
bottomoffset="10" heighttype="FitToContent" height="0" widthtype="Percentage" width="100"
componenttype="buttonsComponent" />
</layout>
<layout name="ChartLayout">
<component name="Title" leftoffset="10" topoffset="10" rightoffset="10" bottomattachment="Steps"
bottomoffset="10" heighttype="FitToContent" height="0" widthtype="Percentage" width="100"
componenttype="startPageHeaderComponent" />
<component name="Steps" leftoffset="10" topattachment="Title" topoffset="0" rightattachment="Chart"
rightoffset="0" bottomattachment="Submit" bottomoffset="10" heighttype="Percentage" height="100"
widthtype="Percentage" width="30" componenttype="stepsListComponent" />
<component name="Chart" leftattachment="Steps" leftoffset="0" topattachment="Title" topoffset="0"
rightoffset="10" bottomattachment="Submit" bottomoffset="10" heighttype="Percentage" height="100"
widthtype="Percentage" width="70" componenttype="chartComponent" />
<component name="Submit" leftoffset="10" topattachment="Chart" topoffset="0" rightoffset="10"
bottomoffset="10" heighttype="FitToContent" height="0" widthtype="Percentage" width="100"
componenttype="buttonsComponent" />
</layout>
</uidefinition>
<description>Demo layout</description>
</extension>
IronPython Script
Below is the IronPython script, main.py.
This script defines all the functions executed by the callbacks in our XML extension file. Note that the
functions reference the defined layouts using GetComponent().
def onrefreshTabularDataSample(step):
comp = step.UserInterface.GetComponent("TabularData")
table = step.Properties["Table"]
comp.SetPropertyTable(table)
def onrefreshChartSample(step):
table = step.PreviousStep.Properties["Table"]
tableValue = table.Value
rowCount = table.RowCount
x = []
y = []
for rowIndex in range(0, rowCount):
x.append(tableValue["Table/Time"][rowIndex].Value.Value)
y.append(tableValue["Table/Pressure"][rowIndex].Value.Value)
comp = step.UserInterface.GetComponent("Chart")
comp.Plot(x, y)
def onresetTabularDataSample(step):
#nothing to do
pass
291
Examples
Note that data must be entered into the TabularData component in order for the Submit components Next button to become enabled.
This is the ChartLayout layout used for the Chart Sample step.
The Chart component contains the chart generated for the tabular data entered in the previous step.
292
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Description
Location
Easy-to-navigate HTML
document providing both API
and XML reference materials.
Note
The content of the XML file is case-sensitive.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
293
<extension>
The main XML element for an XML extension definition file is the <extension> element, which
provides initialization and configuration information for the extension. This is the base tag or root
element under which all other elements fall.
<extension version="[version number]" minorversion="[minor version number]"
name="[extension name]">
<author>author name</author>
<description>description of the extension</description>
<assembly src="[source file name (string)]"
namespace="[namespace (string)]"/>
</extension>
Beneath the <extension> element are the secondary elements that make up the extension.
The secondary elements and the attributes for the <extension> element are listed below. Click the
links to access the corresponding sections in this document.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
<extension>
<Wizard> (p. 303)
Defines one or more wizards (custom templates for AIM or wizards for other applications) within the extension.
<Workflow> (p. 304)
Defines custom workflows composed of process integration items (tasks and task groups).
name
Name of the extension.
Mandatory attribute.
name="[extension name (string)]"
minorversion
Minor version of the extension.
Optional attribute.
minorversion="[minor version number (integer)]"
debug
Specifies if the scripted version of the extension should be opened in Debug mode.
Optional attribute.
icon
Icon for the extension.
Optional attribute.
<Application>
Defines a new application.
<application>
<callbacks> ... </callbacks>
<description>
<description>
<panel>
</application>
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
295
<appStoreId>
Defines a unique identifier for the ACT application to be used in the ANSYS ACT Application Store.
No sub-element tags, attributes, or callbacks.
<appstoreid>appStoreId</appstoreid>
<assembly>
Defines the assembly to be loaded.
<assembly src="[file name]" namespace="[namespace]"/>
296
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
<extension>
src
Name of the dll file to import.
Mandatory.
src="[file name]"
<author>
Defines the author of the extension.
No sub-element tags, attributes, or callbacks.
<author>[Name of the author or organisation (string)]</author>
<description>
Defines the description of the extension.
No sub-element tags, attributes, or callbacks.
<description>[Description (string)]</description>
<Guid>
Defines a unique identifier for the extension.
The GUID is he unique identifier of the extension. Two extensions with the same GUID will be considered
by ACT as the same extension. This is very important when the extension is deployed to ensure that
two different extensions will never be in conflict (have the same name, for example). This identifier
must be added at least before the first build of the extension and must never changed after that. When
the extension is updated, a new version created, or features added, the GUID must be kept unchanged.
<guid shortid="[name (string)]">GUID</guid>
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
297
<Interface>
Defines the user interface for the extension.
<extension version="[version id (integer)]"
name="[extension name (string)]"
<interface context="[Project | Mechanical]">
...
</interface>
<toolbar>
Defines a toolbar.
<toolbar name="[toolbar internal name (string)]" caption="[toolbar display name (string)]">
<entry>...</entry>
</toolbar>
<GetPreCommands>
Called to collect all "pre" commands to add to the solver input file.
<getprecommands>[function(analysis,stream)]</getprecommands>
<GetSolveCommands>
Called to collect all "solve" commands to add to the solver input file.
<getsolvecommands timedependent="[true | false(default)]">
298
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
<extension>
<IsAnalysisValid>
Called to check if an analysis is valid.
<isanalysisvalid>[function(solver)]</isanalysisvalid>
<OnActiveObjectChange>
Called when the active object is changed.
<OnAfterGeometryUpdate>
Called after the geometry has been updated.
<OnAfterRemove>
Called after the object has been removed.
<OnAfterSolve>
Called after an analysis has been solved.
<onaftersolve>[function(analysis)]</onaftersolve>
<OnBeforeGeometryUpdate>
Called before the geometry is starts to update.
<OnBeforeSolve>
Called before an analysis starts to solve.
<onbeforesolve>[function(analysis)]</onbeforesolve>
<OnBodySuppressStateChange>
Called when the body suppress state has been changed.
<OnDraw>
Called when the application is drawn.
<OnDraw2D>
Called when the application is drawn.
<ondraw>[function()]</ondraw>
<OnInit>
Called when the given context is initialized.
<oninit>[function name(application context)] </oninit>
<OnLoad>
Called when a project is loaded.
<onload>[function(currentFolder)]</onload>
<OnMeshCleaned>
Called when the mesh is cleaned.
<OnMeshGenerated>
Called when the mesh is generated.
<OnPostFinished>
Called when the postprocessing ends for a given analysis.
<onpostfinished>[function(analysis)]</onpostfinished>
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
299
<OnReady>
Called when the application is fully loaded and in a "ready" state.
<OnSave>
Called when the project is saved.
<onsave>[function(currentFolder)]</onsave>
<OnTerminate>
Called when the given context is terminated.
<onterminate>[function(context)]</onterminate>
<Resume>
Called when a project is loaded.
<resume>[function(binary reader)]</resume>
<Save>
Called when a project is saved.
<save>[function(binary writer)]</save>
<Licenses>
Defines a licenses collection for the extension.
No sub-element tags, attributes, or callbacks.
<script>
Specifies the IronPython script referenced by the extension.
<extension version="[version id (integer)]"
name="[extension name (string)]"
<script src="[python file name (string)]"></script></extension>
You can either insert the IronPython script directly into the XML file, or use the src attribute to specify
the path to the script.
Additional paths can be specified by adding new <script> elements. For example:
<script src="[Path]\filename.py" />
300
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
<extension>
src
Specifies the IronPython script referenced by the extension.
Optional.
src="[python file name (string)]"
<simdata>
Defines a general section that stores all user object definitions.
The <simdata> element information pertains specifically to the simulation environment. Child elements
are used for integrating custom simulation features into the application. These main features are nested
as child elements within the <simdata> element.
<simdata>
<load>
<object>
<optimizer>
<solver>
<geometry>
<result>
<step>
<ExtensionObject>
<Sampling>
</simdata>
<object>
Defines a simulation object.
<object>
<callbacks> ... </callbacks>
<property>
<propertygroup>
<propertytable>
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
301
<optimizer>
Defines an optimizer.
<optimizer>
<callbacks> ... </callbacks>
<property>
<propertygroup>
<propertytable>
</optimizer>
<solver>
Specifies pecifying a third-party solver to be used in the simulation.
<optimizer>
<callbacks> ... </callbacks>
<property>
<propertygroup>
<propertytable>
</optimizer>
<geometry>
Defines a geometry feature.
<geometry>
<callbacks> ... </callbacks>
<property>
<propertygroup>
<propertytable>
</geometry>
<result>
Defines a custom result.
<result>
<callbacks> ... </callbacks>
<property>
<propertygroup>
<propertytable>
</result>
<step>
Defines a step in a wizard.
<step>
<callbacks> ... </callbacks>
<description>
<property>
<propertygroup>
</step>
<ExtensionObject>
Extends the extension object definition. (Inherited from DesignXplorer SimEntity)
<extensionobject>
<callbacks> ... </callbacks>
<property>
<propertygroup>
<propertytable>
<target>
</extensionobject>
302
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
<extension>
<Sampling>
Defines a custom sampling.
<sampling>
<callbacks> ... </callbacks>
<property>
<propertygroup>
<propertytable>
<target>
</sampling>
<Templates>
Defines a collection of control templates.
<templates>
<controltemplate name="[template name (string)]" version="[version id (integer)]">
<propertygroup>
<property> ... </property>
<propertygroup> ... </propertygroup>
</propertygroup>
</controltemplate>
</templates>
<UIDefintion>
Defines one or more layouts that can be used for wizards.
<uidefinition>
<layout>
</uidefinition>
<Wizard>
Defines one or more wizards within the extension.
<wizard>
<author>
<description>
<step></step>
</wizard>
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
303
<Workflow>
Defines custom workflows composed of process integration items (tasks and task groups). Defines the
top-level workflow tag within an ACT app.
<workflow>
<callbacks> ... </callbacks>
<taskgroups>
304
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
<extension>
<tasks>
</workflow>
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
305
306
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
<extension>
<onaftertaskcanduplicate>
Invoked after the task has checked whether it permits duplication.
<onbeforetaskstatus>
Invoked before the task calculates its current state.
<onaftertaskstatus>
Invoked after the task has calculated its current state.
<onbeforetaskpropertyretrieval>
Invoked before the task determines the visibility of its property-containing objects.
<onaftertaskpropertyretrieval>
Invoked after the task has determined the visibility of its property-containing objects.
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
307
308
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Task
Input
Output
AUTODYN_Remap
AutodynSetup
Autodyn
Setup
MechanicalSetup
SimulationGeneratedMesh
Analysis
None
None
Input
Output
None
TurboGeometry
Table 9: BladeGen
Taskgroup
Task
BladeGen
Blade
Design
VistaGeometry
BladeGen
(Beta)
Blade
Design
None
TurboGeometry
VistaGeometry
Task
Input
Output
SimulationGeneratedMesh
CFXSetup
CFXMesh
SystemCouplingSetupData
CFX
(Beta)
Setup
MechanicalSetup
Solution
CFXSetup
CFXSolution
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
309
Task
Input
Output
CFXSolution
CFX
Setup
SimulationGeneratedMesh
CFXSetup
CFXMesh
SystemCouplingSetupData
MechanicalSetup
Solution
CFXSetup
CFXSolution
CFXSolution
Results
CFXSolution
CFDAnalysis
FluentSolution
ForteSolution
VistaTFSolution
IcePakResults
PolyflowSolutionType
MechanicalSolution
ICEData
Table 11: Design Assessment
Taskgroup
Task
Input
Output
ExternalModelOutputProvider
Material
FEMSetup
EngineeringData
Design
Assessment
Engineering
Data
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
310
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
GeneralTransfer
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
SimulationSolutionDataInternal
MechanicalSolution
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolutionDataInternal
SimulationSolution
SimulationSolutionOutputProvider
Results
SimulationSolution
MechanicalResults
SimulationResults
Task
Input
Output
DesignPointsDataTransfer
OptimizationModel
Input
Output
ExternalModelOutputProvider
EngineeringData
FEMSetup
Material
Direct
Optimization
Optimization
Task
Electric
Engineering
Data
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
311
Task
Input
Output
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
SimulationSolutionDataInternal
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolution
SimulationSolutionDataInternal
SimulationSolutionOutputProvider
Results
SimulationSolution
312
MechanicalResults
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
SimulationResults
Task
Input
Output
ExternalModelOutputProvider
Material
FEMSetup
EngineeringData
Engineering
Data
Engineering
Data
MatML31
Table 15: Explicit Dynamics
Taskgroup
Task
Input
Output
ExternalModelOutputProvider
EngineeringData
FEMSetup
Material
Explicit
Dynamics
Engineering
Data
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
313
Task
Input
Output
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
SimulationSolutionDataInternal
EnhancedMechanicalModel
EnhancedModelData
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolutionDataInternal
SimulationSolution
SimulationSolutionOutputProvider
Results
SimulationSolution
MechanicalResults
SimulationResults
Task
Input
Output
Explicit
Dynamics
(LS-DYNA
Export)
Engineering
Data
ExternalModelOutputProvider
FEMSetup
EngineeringData
MatML31
Material
FEMSetup
Geometry
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
314
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
GeneralTransfer
Table 17: External Data
Taskgroup
Task
Input
Output
None
ExternalDataSetup
External
Data
Setup
ExternalTraceDataSetup
Table 18: External Model
Taskgroup
Task
Input
Output
None
ExternalModelOutputProvider
External
Model
Setup
Task
Input
Output
External
Connection
External
Connection
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
315
Task
Input
Output
None
ExternalConnectionProperties
Task
Input
Output
MechanicalSetup
FEMMesh
SimulationGeneratedMesh
FEMSetup
MAPDLCdb
Geometry
Finite
Element
Modeler
Model
FEMSetup
SolidSectionData
CompositeEngineeringData
SimulationEngineeringData
Table 21: Fluent (with Fluent Meshing)
Taskgroup
Task
Input
Output
FluentMesh
FluentTGridMesh
Fluent
Mesh
Geometry
Setup
AIMFluentMeshOutputProvider
FluentSetup
AnsoftHeatLossDataObject
SystemCouplingSetupData
FluentCase
FluentImportable
FluentMesh
FluentTGridMesh
ICEData
ICESetupData
SimulationGeneratedMesh
Solution
FluentSetup
FluentSolution
FluentSolution
Table 22: Fluent
Taskgroup
Task
Input
Output
Fluent
Setup
316
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
AIMFluentMeshOutputProvider
FluentSetup
FluentImportable
SystemCouplingSetupData
AnsoftHeatLossDataObject
FluentMesh
FluentCase
SimulationGeneratedMesh
ICEData
ICESetupData
FluentTGridMesh
Solution
FluentSetup
FluentSolution
FluentSolution
Table 23: Fluid Flow Blow Molding (Polyflow)
Taskgroup
Task
Input
Output
FEMSetup
Geometry
Fluid
Flow
Blow
Molding
(Polyflow)
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Mesh
Geometry
MechanicalModel
MeshingGeneratedMeshOutputProvider
MeshingMesh
SimulationGeneratedMesh
MeshingGeneratedMeshOutputProvider
Setup
SimulationGeneratedMesh
PolyflowSetup
PolyflowTransferMesh
Solution
PolyflowSetup
PolyflowSolutionType
PolyflowSolution
PolyflowSolution
ExternalDataSetup
Results
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
317
Task
Input
Output
CFXSolution
CFD Analysis
FluentSolution
ForteSolution
VistaTFSolution
IcePakResults
PolyflowSolutionType
MechanicalSolution
ICEData
Table 24: Fluid Flow Extrusion (Polyflow)
Taskgroup
Task
Input
Output
FEMSetup
Geometry
Fluid
Flow
Extrusion
(Polyflow)
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Mesh
Geometry
MechanicalModel
MeshingGeneratedMeshOutputProvider
MeshingMesh
SimulationGeneratedMesh
MeshingGeneratedMeshOutputProvider
Setup
SimulationGeneratedMesh
PolyflowSetup
PolyflowTransferMesh
Solution
PolyflowSetup
PolyflowSolutionType
PolyflowSolution
PolyflowSolution
ExternalDataSetup
Results
CFXSolution
CFDAnalysis
FluentSolution
ForteSolution
VistaTFSolution
IcePakResults
318
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
PolyflowSolutionType
MechanicalSolution
ICEData
Table 25: Fluid Flow (CFX)
Taskgroup
Task
Input
Output
FEMSetup
Geometry
Fluid
Flow
(CFX)
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Mesh
Geometry
MechanicalModel
MeshingGeneratedMeshOutputProvider
MeshingMesh
SimulationGeneratedMesh
MeshingGeneratedMeshOutputProvider
Setup
SimulationGeneratedMesh
CFXSetup
CFXMesh
SystemCouplingSetupData
MechanicalSetup
Solution
CFXSetup
CFXSolution
CFXSolution
Results
CFXSolution
CFDAnalysis
FluentSolution
ForteSolution
VistaTFSolution
IcePakResults
MechanicalSolution
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
319
Task
Input
Output
ICEData
Table 26: Fluid Flow (Fluent)
Taskgroup
Task
Input
Output
FEMSetup
Geometry
Fluid
Flow
(Fluent)
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Mesh
Geometry
MechanicalModel
MeshingGeneratedMeshOutputProvider
MeshingMesh
SimulationGeneratedMesh
MeshingGeneratedMeshOutputProvider
Setup
AIMFluentMeshOutputProvider
FluentImportable
FluentSetup
AnsoftHeatLossDataObject
SystemCouplingSetupData
FluentMesh
FluentCase
SimulationGeneratedMesh
ICEData
ICESetupData
FluentTGridMesh
Solution
FluentSetup
FluentSolution
FluentSolution
Results
CFXSolution
CFDAnalysis
FluentSolution
ForteSolution
VistaTFSolution
IcePakResults
PolyflowSolutionType
MechanicalSolution
320
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
ICEData
Table 27: Fluid Flow (Polyflow)
Taskgroup
Task
Input
Output
FEMSetup
Geometry
Fluid
Flow
(Polyflow)
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Mesh
Geometry
MechanicalModel
MeshingGeneratedMeshOutputProvider MeshingMesh
SimulationGeneratedMesh
MeshingGeneratedMeshOutputProvider
Setup
SimulationGeneratedMesh
PolyflowSetup
PolyflowTransferMesh
Solution
PolyflowSetup
PolyflowSolutionType
PolyflowSolution
PolyflowSolution
ExternalDataSetup
Results
CFXSolution
CFDAnalysis
FluentSolution
ForteSolution
VistaTFSolution
IcePakResults
PolyflowSolutionType
MechanicalSolution
ICEData
Table 28: Geometry
Taskgroup
Task
Input
Output
Geometry
Geometry
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
321
Task
Input
Output
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Table 29: Harmonic Response
Taskgroup
Task
Input
Output
ExternalModelOutputProvider
EngineeringData
FEMSetup
Material
Harmonic
Response
Engineering
Data
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
322
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
EnhancedModelData
EnhancedMechanicalModel
ExternalDataSetup
MechanicalSolution
AnsoftForceAndMomentDataObject
SimulationSolutionDataInternal
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolution
SimulationSolutionDataInternal
SimulationSolutionOutputProvider
Results
SimulationSolution
MechanicalResults
SimulationResults
Task
Input
Output
FEMSetup
Geometry
Hydrodynamic
Diffraction
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
Geometry
AqwaModel
AqwaModel
AqwaSetup
AqwaSetup
AqwaSolution
AqwaSolution
AqwaResults
Setup
Solution
Results
Task
Input
Output
Hydrodynamic
Response
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
323
Task
Input
Output
FEMSetup
Geometry
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
Geometry
AqwaModel
AqwaModel
AqwaSetup
Setup
AqwaSolution
Solution
AqwaSetup
AqwaSolution
AqwaSolution
AqwaResults
Input
Output
None
ICEData
FEMSetup
Geometry
Results
Task
ICE
Engine
(Fluent)
ICE
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Mesh
Geometry
MechanicalModel
MeshingGeneratedMeshOutputProvider
MeshingMesh
SimulationGeneratedMesh
MeshingGeneratedMeshOutput
-Provider
ICE
Solver
Setup
SimulationGeneralMesh
ICESetupData
SimulationGeneratedMesh
324
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
Setup
AIMFluentMeshOutputProvider
FluentImportable
FluentSetup
AnsoftHeatLossDataObject
SystemCouplingSetupData
FluentMesh
FluentCase
SimulationGeneratedMesh
ICEData
ICESetupData
FluentTGridMesh
Solution
FluentSetup
FluentSolution
FluentSolution
Results
CFXSolution
CFDAnalysis
FluentSolution
ForteSolution
VistaTFSolution
IcePakResults
PolyflowSolutionType
MechanicalSolution
ICEData
Table 33: IC Engine (Forte)
Taskgroup Task
Input
Output
None
ICEData
IC
Engine
(Forte)
ICE
GeometryCellTemplate
AnsoftCADObject
Geometry
FEMSetup
Geometry
ICEData
TurboGeometry
Mesh
Geometry
MechanicalModel
MeshingGeneratedMeshOutputProvider
MeshingGeneratedMeshOutputProvider
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
325
Input
Output
MeshingMesh
SimulationGeneratedMesh
ICE Setup
SimulationGeneralMesh
ICESetupData
SimulationGeneratedMesh
Forte
FluentTGridMesh
ForteSolution
ICESetupData
SimulationGeneralMesh
SimulationGeneratedMesh
Results
CFXSolution
CFDAnalysis
FluentSolution
ForteSolution
ICEData
IcePakResults
MechanicalSolution
PolyflowSolutionType
VistaTFSolution
Table 34: ICEM CFD
Taskgroup
Task
Input
Model
FluentImportable
Output
ICEM
CFD
Geometry
SimulationGeneratedMesh
MeshingMesh
MechanicalMesh
Table 35: Icepak
Taskgroup
Task
Input
Output
Geometry
IcePakSetup
Icepak
Setup
AnsoftHeatLossDataObject
Solution
326
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
IcePakSetup
IcePakResults
Task
Input
Output
ExternalModelOutputProvider
EngineeringData
FEMSetup
Material
Eigenvalue
Buckling
Engineering
Data
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
SimulationSolutionDataInternal
EnhancedMechanicalModel
EnhancedModelData
GeneralTransfer
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
327
Task
Input
Output
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolutionDataInternal
Solution
SimulationSolution
SimulationSolutionOutputProvider
Results
SimulationSolution
MechanicalResults
SimulationResults
ExternalModelOutputProvider
Task
Input
Output
ExternalModelOutputProvider
EngineeringData
FEMSetup
Material
Eigenvalue
Buckling
(Samcef )
Engineering
Data
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
328
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
SimulationSolutionDataInternal
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolution
SimulationSolutionDataInternal
SimulationSolutionOutputProvider
Results
SimulationSolution
MechanicalResults
SimulationResults
Task
Input
Output
ExternalModelOutputProvider
EngineeringData
FEMSetup
Material
Magnetostatic
Engineering
Data
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
329
Task
Input
Output
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolution
SimulationSolutionDataInternal
SimulationSolutionOutputProvider
Results
SimulationSolution
MechanicalResults
SimulationResults
Task
Input
Output
FeedbackIteratorSetup
FeedbackIteratorEntity
Input
Output
MechanicalSetup
None
Feedback
Iterator
Feedback
Iterator
Task
Mechanical
APDL
Analysis
SimulationGeneratedMesh
FEMSetup
Geometry
SolidSectionData
MechanicalSolution
MAPDLSolution
MAPDLDatabase
330
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
MAPDLResults
MAPDLCdb
Table 41: Mechanical Model
Taskgroup
Task
Input
Output
ExternalModelOutputProvider
EngineeringData
FEMSetup
Material
Mechanical
Model
Engineering
Data
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Table 42: Mesh
Taskgroup
Task
Input
Output
FEMSetup
Geometry
Mesh
Geometry
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
331
Task
Input
Output
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Mesh
Geometry
MechanicalModel
MeshingGeneratedMeshOutputProvider
MeshingMesh
SimulationGeneratedMesh
MeshingGeneratedMeshOutputProvider
Table 43: Microsoft Office Excel
Taskgroup
Task
Input
Output
None
MSExcelSetup
Input
Output
ExternalModelOutputProvider
EngineeringData
FEMSetup
Material
Microsoft
Office
Excel
Analysis
Task
Modal
(ABAQUS)
Engineering
Data
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
332
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
SimulationSolutionDataInternal
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolution
SimulationSolutionDataInternal
SimulationSolutionOutputProvider
Results
SimulationSolution
MechanicalResults
SimulationResults
Task
Input
Output
ExternalModelOutputProvider
EngineeringData
FEMSetup
Material
Modal
Engineering
Data
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
CompositeEngineeringData
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
333
Task
Input
Output
EngineeringData
EnhancedModelData
MechanicalModel
ExternalDataSetup
MechanicalMesh
ExternalModelOutputProvider
SimulationGeneratedMesh
ExternalTraceDataSetup
SimulationEngineeringData
GeneralTransfer
Geometry
SimulationModelGeneratedMesh
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
SimulationSolutionDataInternal
EnhancedMechanicalModel
EnhancedModelData
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolution
SimulationSolutionDataInternal
SimulationSolutionOutputProvider
Results
SimulationSolution
ExternalModelOutputProvider
MechanicalResults
SimulationResults
Task
Input
Output
ExternalModelOutputProvider
EngineeringData
FEMSetup
Material
Modal
(NASTRAN)
Engineering
Data
MatML31
Geometry
334
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolutionDataInternal
SimulationSolution
SimulationSolutionOutputProvider
Results
SimulationSolution
MechanicalResults
SimulationResults
Task
Input
Output
Modal
(Samcef )
Engineering
Data
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
335
Task
Input
Output
ExternalModelOutputProvider
EngineeringData
FEMSetup
Material
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
SimulationSolutionDataInternal
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolution
SimulationSolutionDataInternal
SimulationSolutionOutputProvider
Results
SimulationSolution
336
MechanicalResults
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
SimulationResults
Task
Input
Output
ResponseSurfaceDataTransfer
CorrelationModel
Parameters
Correlation
Parameters
Correlation
DesignPointsDataTransfer
Table 49: Polyflow Blow Molding
Taskgroup
Task
Input
Output
SimulationGeneratedMesh
PolyflowSetup
Polyflow
Blow
Molding
Setup
PolyflowTransferMesh
Solution
PolyflowSetup
PolyflowSolutionType
PolyflowSolution
PolyflowSolution
ExternalDataSetup
Task
Input
Output
SimulationGeneratedMesh
PolyflowSetup
Polyflow
Extrusion
Setup
PolyflowTransferMesh
Solution
PolyflowSetup
PolyflowSolutionType
PolyflowSolution
PolyflowSolution
ExternalDataSetup
Task
Input
Output
Polyflow
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
337
Task
Input
Output
SimulationGeneratedMesh
PolyflowSetup
Setup
PolyflowTransferMesh
Solution
PolyflowSetup
PolyflowSolutionType
PolyflowSolution
PolyflowSolution
ExternalDataSetup
Task
Input
Output
ExternalModelOutputProvider
EngineeringData
FEMSetup
Material
Random
Vibration
Engineering
Data
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
CompositeEngineeringData
MechanicalModel
EngineeringData
MechanicalMesh
EnhancedModelData
SimulationGeneratedMesh
ExternalDataSetup
SimulationEngineeringData
ExternalModelOutputProvider
SimulationModelGeneratedMesh
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
338
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
SimulationSolutionDataInternal
EnhancedMechanicalModel
EnhancedModelData
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolutionDataInternal
SimulationSolution
SimulationSolutionOutputProvider
Results
SimulationSolution
MechanicalResults
SimulationResults
Task
Input
Output
ExternalModelOutputProvider
EngineeringData
FEMSetup
Material
Response
Spectrum
Engineering
Data
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
CompositeEngineeringData
MechanicalModel
EngineeringData
MechanicalMesh
EnhancedModelData
SimulationGeneratedMesh
ExternalDataSetup
SimulationEngineeringData
ExternalModelOutputProvider
SimulationModelGeneratedMesh
ExternalTraceDataSetup
GeneralTransfer
Geometry
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
339
Task
Input
Output
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
SimulationSolutionDataInternal
EnhancedMechanicalModel
EnhancedModelData
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolutionDataInternal
SimulationSolution
SimulationSolutionOutputProvider
Results
SimulationSolution
MechanicalResults
SimulationResults
Task
Input
Output
None
ParametricContext
Response
Surface
Design of
Experiments
DOEModel
DesignPointsDataTransfer
Response
Surface
340
ParametricContext
ResponseSurfaceModel
DOEModel
ResponseSurfaceDataTransfer
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
DesignPointsDataTransfer
Task
Input
Output
None
ParametricContext
Response
Surface
Optimization
Design of
Experiments
DOEModel
DesignPointsDataTransfer
Response
Surface
ParametricContext
ResponseSurfaceModel
DOEModel
ResponseSurfaceDataTransfer
DesignPointsDataTransfer
Optimization
ParametricContext
OptimizationModel
ResponseSurfaceModel
Table 56: Results
Taskgroup
Task
Input
Output
CFXSolution
CFDAnalysis
Results
Results
FluentSolution
ForteSolution
VistaTFSolution
IcePakResults
PolyflowSolutionType
MechanicalSolution
ICEData
Table 57: Rigid Dynamics
Taskgroup
Task
Input
Output
Rigid
Dynamics
Engineering
Data
ExternalModelOutputProvider
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
341
Task
Input
Output
FEMSetup
EngineeringData
MatML31
Material
FEMSetup
Geometry
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolutionDataInternal
SimulationSolution
SimulationSolutionOutputProvider
Results
SimulationSolution
342
MechanicalResults
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
SimulationResults
Task
Input
Output
ExternalModelOutputProvider
EngineeringData
FEMSetup
Material
Shape
Optimization
Engineering
Data
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
SimulationSolutionDataInternal
CFXSolution
FluentSolution
IcePakResults
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
343
Task
Input
Output
MechanicalSolution
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolutionDataInternal
SimulationSolution
SimulationSolutionOutputProvider
Results
SimulationSolution
MechanicalResults
SimulationResults
Task
Input
Output
Six
Sigma
Analysis
Design of
Experiments
(SSA)
ParametricContext
DOEModel
DesignPointsDataTransfer
Response
Surface
(SSA)
ParametricContext
ResponseSurfaceModel
DOEModel
ResponseSurfaceDataTransfer
DesignPointsDataTransfer
Six
Sigma
Analysis
ParametricContext
SixSigmaModel
ResponseSurfaceModel
Table 60: Static Structural (ABAQUS)
Taskgroup
Task
Input
Output
Static
Structural
(ABAQUS)
Engineering
Data
ExternalModelOutputProvider
344
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
FEMSetup
EngineeringData
MatML31
Material
FEMSetup
Geometry
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
Geometry
GeneralTransfer
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
SimulationSolutionDataInternal
CFXSolution
FluentSolution
IcePakResults
MechanicalSolution
ExternalDataSetup
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolutionDataInternal
SimulationSolution
SimulationSolutionOutputProvider
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
345
Task
Input
Output
SimulationSolution
MechanicalResults
Results
SimulationResults
Table 61: Static Structural
Taskgroup
Task
Input
Output
ExternalModelOutputProvider
EngineeringData
FEMSetup
Material
Static
Structural
Engineering
Data
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
EnhancedModelData
SystemCouplingSetupData
SimulationSolutionDataInternal
346
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
CFXSolution
FluentSolution
IcePakResults
MechanicalSolution
ExternalDataSetup
AnsoftForceDataObject
EnhancedMechanicalModel
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolutionDataInternal
SimulationSolution
SimulationSolutionOutputProvider
Results
SimulationSolution
ExternalModelOutputProvider
MechanicalResults
SimulationResults
Task
Input
Output
ExternalModelOutputProvider
EngineeringData
FEMSetup
Material
Static
Structural
(Samcef )
Engineering
Data
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
347
Task
Input
Output
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
SimulationSolutionDataInternal
CFXSolution
FluentSolution
IcePakResults
MechanicalSolution
ExternalDataSetup
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolutionDataInternal
SimulationSolution
ExternalModelOutputProvider
Results
SimulationSolution
MechanicalResults
SimulationResults
Task
Input
Output
Steady-State
Thermal
(ABAQUS)
Engineering
Data
ExternalModelOutputProvider
348
FEMSetup
EngineeringData
MatML31
Material
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
FEMSetup
Geometry
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
FluentSolution
IcePakResults
MechanicalSolution
SimulationSolutionDataInternal
CFXSolution
ExternalDataSetup
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolutionDataInternal
SimulationSolution
SimulationSolutionOutputProvider
Results
SimulationSolution
MechanicalResults
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
349
Task
Input
Output
SimulationResults
Task
Input
Output
ExternalModelOutputProvider
EngineeringData
FEMSetup
Material
Steady-State
Thermal
Engineering
Data
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
SimulationSolutionDataInternal
SystemCouplingSetupData
CFXSolution
FluentSolution
IcePakResults
350
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
MechanicalSolution
ExternalDataSetup
AnsoftHeatLossDataObject
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolutionDataInternal
SimulationSolution
SimulationSolutionOutputProvider
Results
SimulationSolution
MechanicalResults
SimulationResults
Task
Input
Output
ExternalModelOutputProvider
EngineeringData
FEMSetup
Material
Steady-State
Thermal
Engineering
Data
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
Geometry
GeneralTransfer
Modeler
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
351
Task
Input
Output
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
SimulationSolutionDataInternal
CFXSolution
FluentSolution
IcePakResults
MechanicalSolution
ExternalDataSetup
AnsoftHeatLossDataObject
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolutionDataInternal
SimulationSolution
SimulationSolutionOutputProvider
Results
SimulationSolution
MechanicalResults
SimulationResults
Task
Input
Output
SystemCouplingSetupData
CouplingSetupProvider
System
Coupling
Setup
ExternalDataSetup
Solution
CouplingSetupProvider
None
Input
Output
Task
Thermal-Electric
Engineering
Data
352
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
ExternalModelOutputProvider
EngineeringData
FEMSetup
Material
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
Geometry
GeneralTransfer
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
CFXSolution
FluentSolution
IcePakResults
ExternalDataSetup
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolutionDataInternal
SimulationSolution
SimulationSolutionOutputProvider
Results
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
353
Task
Input
Output
SimulationSolution
MechanicalResults
SimulationResults
Task
Input
Output
FEMSetup
Geometry
Throughflow
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Setup
VistaGeometry
VistaTFSetup
VistaTFPhysics
Geometry
Solution
VistaTFSetup
VistaTFSolution
VistaTFSolution
Results
CFXSolution
CFDAnalysis
FluentSolution
ForteSolution
VistaTFSolution
IcePakResults
PolyflowSolutionType
MechanicalSolution
ICEData
Table 69: Throughflow (BladeGen)
Taskgroup
Task
Input
Output
None
TurboGeometry
Throughflow
(BladeGen)
Blade
Design
VistaGeometry
Setup
VistaGeometry
354
VistaTFSetup
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
VistaTFPhysics
Geometry
Solution
VistaTFSetup
VistaTFSolution
VistaTFSolution
Results
CFXSolution
CFDAnalysis
FluentSolution
ForteSolution
VistaTFSolution
IcePakResults
PolyflowSolutionType
MechanicalSolution
ICEData
Table 70: Transient Structural (ABAQUS)
Taskgroup
Task
Input
Output
ExternalModelOutputProvider
EngineeringData
FEMSetup
Material
Transient
Structural
(ABAQUS)
Engineering
Data
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
355
Task
Input
Output
Geometry
GeneralTransfer
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
SimulationSolutionDataInternal
CFXSolution
FluentSolution
IcePakResults
MechanicalSolution
ExternalDataSetup
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolutionDataInternal
SimulationSolution
SimulationSolutionOutputProvider
Results
SimulationSolution
MechanicalResults
SimulationResults
Task
Input
Output
Transient
Structural
Engineering
Data
ExternalModelOutputProvider
FEMSetup
EngineeringData
MatML31
Material
FEMSetup
Geometry
Geometry
TurboGeometry
AnsoftCADObject
356
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
EnhancedModelData
SystemCouplingSetupData
SimulationSolutionDataInternal
CFXSolution
FluentSolution
IcePakResults
MechanicalSolution
ExternalDataSetup
AnsoftForceDataObject
EnhancedMechanicalModel
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolutionDataInternal
SimulationSolution
SimulationSolutionOutputProvider
Results
SimulationSolution
ExternalModelOutputProvider
MechanicalResults
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
357
Task
Input
Output
SimulationResults
Task
Input
Output
FEMSetup
EngineeringData
MatML31
Material
FEMSetup
Geometry
Transient
Structural
(Samcef )
Engineering
Data
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
SimulationSolutionDataInternal
CFXSolution
FluentSolution
IcePakResults
358
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
MechanicalSolution
ExternalDataSetup
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolutionDataInternal
SimulationSolution
Results
SimulationSolution
MechanicalResults
SimulationResults
Task
Input
Output
ExternalModelOutputProvider
Material
FEMSetup
EngineeringData
Transient
Thermal
(ABAQUS)
Engineering
Data
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
359
Task
Input
Output
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
SimulationSolutionDataInternal
CFXSolution
FluentSolution
IcePakResults
MechanicalSolution
ExternalDataSetup
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolutionDataInternal
SimulationSolution
SimulationSolutionOutputProvider
Results
SimulationSolution
MechanicalResults
SimulationResults
Task
Input
Output
ExternalModelOutputProvider
Material
FEMSetup
EngineeringData
Transient
Thermal
Engineering
Data
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
360
MechanicalModel
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
SimulationSolutionDataInternal
SystemCouplingSetupData
CFXSolution
FluentSolution
IcePakResults
MechanicalSolution
ExternalDataSetup
AnsoftHeatLossDataObject
GeneralTransfer
Solution
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolutionDataInternal
SimulationSolution
SimulationSolutionOutputProvider
Results
SimulationSolution
MechanicalResults
SimulationResults
Task
Input
Output
Transient
Thermal
(Samcef )
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
361
Task
Input
Output
ExternalModelOutputProvider
Material
FEMSetup
EngineeringData
Engineering
Data
MatML31
Geometry
FEMSetup
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Model
AIMGeometryMeshOutputProvider
MechanicalModel
CompositeEngineeringData
MechanicalMesh
EngineeringData
SimulationGeneratedMesh
EnhancedModelData
SimulationEngineeringData
ExternalDataSetup
SimulationModelGeneratedMesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationSolutionOutputProvider
SolidSectionData
Setup
MechanicalModel
SimulationSetup
MechanicalMesh
MechanicalSetup
SimulationSolutionDataInternal
CFXSolution
FluentSolution
IcePakResults
MechanicalSolution
ExternalDataSetup
GeneralTransfer
Solution
362
SimulationSetup
MechanicalSolution
GeneralTransfer
SimulationSolutionDataInternal
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
SimulationSolution
SimulationSolutionOutputProvider
Results
SimulationSolution
MechanicalResults
SimulationResults
Task
Input
Output
FEMSetup
Geometry
Turbomachinery
Fluid
Flow
(BladeEditor)
Geometry
TurboGeometry
AnsoftCADObject
ICEData
Geometry
Turbo
Mesh
TurboGeometry
TurboMesh
Geometry
CFXMesh
FluentImportable
Setup
SimulationGeneratedMesh
CFXSetup
CFXMesh
SystemCouplingSetupData
MechanicalSetup
Solution
CFXSetup
CFXSolution
CFXSolution
Results
CFXSolution
CFDAnalysis
FluentSolution
ForteSolution
VistaTFSolution
IcePakResults
PolyflowSolutionType
MechanicalSolution
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
363
Task
Input
Output
ICEData
Table 77: TurboGrid
Taskgroup
Task
Input
Output
TurboGeometry
TurboMesh
Geometry
CFXMesh
TurboGrid
Turbo
Mesh
FluentImportable
Table 78: Vista TF
Taskgroup
Task
Input
Output
VistaGeometry
VistaTFSetup
Vista
TF
Setup
VistaTFPhysics
Geometry
Solution
VistaTFSetup
VistaTFSolution
VistaTFSolution
Results
CFXSolution
CFDAnalysis
FluentSolution
ForteSolution
VistaTFSolution
IcePakResults
PolyflowSolutionType
MechanicalSolution
ICEData
Table 79: Vista AFD
Taskgroup
Task
Input
Output
None
VistaAFDMeanlineProvider
VistaAFDMeanlineProvider
VistaAFDDesignProvider
Vista
AFD
Meanline
Design
364
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
VistaAFDDesignProvider
None
Input
Output
None
VistaCCDBladeDesignProvider
Analysis
Task
Vista
CCD
Blade
Design
Task
Input
Output
None
VistaCCDBladeDesignProvider
VistaCCDBladeDesignProvider
None
Input
Output
None
None
Input
Output
Vista
CCD
(with
CCM)
Blade
Design
Performance
Map
Task
Vista
CPD
Blade
Design
Task
Vista
RTD
Blade
Design
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
365
Task
Input
Output
None
None
Input
Output
None
VistaGeometry
Task
Vista
RTD
(Beta)
Blade
Design
VistaTFPhysics
Table 85: ACP (Pre)
Taskgroup
Task
Input
Output
ExternalModelOutputProvider
EngineeringData
FEMSetup
Material
ACP
(Pre)
Engineering
Data
MatML31
Geometry
AnsoftCADObject
Geometry
FEMSetup
Geometry
ICEData
TurboGeometry
Model
AIMGeometryMeshOutputProvider
MechanicalMesh
CompositeEngineeringData
MechanicalModel
EngineeringData
SimulationEngineering Data
EnhancedModelData
SimulationGenerated Mesh
ExternalDataSetup
SimulationModelGenerated Mesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGeneratedMesh
366
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
SimulationSolutionOutputProvider
SolidSectionData
Setup
ACPSetupData
ACPSetupData
EngineeringData
CompositeEngineering Data
Geometry
EnhancedModelData
SimulationEngineeringData
SimulationEngineeringData
SimulationGeneratedMesh
SimulationModelGeneratedMesh
SimulationModelGeneratedMesh
SolidSectionData
Input
Output
ExternalModelOutputProvider
EngineeringData
FEMSetup
Material
Task
ACP
(Post)
Engineering
Data
MatML31
Geometry
AnsoftCADObject
Geometry
FEMSetup
Geometry
ICEData
TurboGeometry
Model
AIMGeometryMeshOutputProvider
MechanicalMesh
CompositeEngineeringData
MechanicalModel
EngineeringData
SimulationEngineering Data
EnhancedModelData
SimulationGenerated Mesh
ExternalDataSetup
SimulationModelGenerated Mesh
ExternalModelOutputProvider
ExternalTraceDataSetup
GeneralTransfer
Geometry
Modeler
SimulationEngineeringData
SimulationModelGenerated
Mesh
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
367
Task
Input
Output
SimulationSolutionOutputProvider
SolidSectionData
Results
EngineeringData
MAPDLSolution
MechanicalSolution
SimulationGeneratedMesh
Table 87: Maxwell 3D
Taskgroup
Task
Input
Output
AnsoftCADGeometryEntity
AnsoftCADObject
AnsoftGeometryManagerData
Object
AnsoftCellInOutEntity
Geometry
AnsoftGeometryManager
DataObject
AnsoftCellInOutEntity
AnsoftCellInOutEntity
Maxwell
3D
Geometry
Setup
FeedbackIteratorSetup
Solution
AnsoftCellInOutEntity
AnsoftForceAndMoment
DataObject
AnsoftForceDataObject
AnsoftHeatLossData Object
Task
Input
Output
AnsoftCADGeometryEntity
AnsoftCADObject
AnsoftGeometryManagerData
Object
AnsoftCellInOutEntity
Geometry
AnsoftGeometryManager
DataObject
AnsoftCellInOutEntity
AnsoftCellInOutEntity
Maxwell
2D
Geometry
Setup
FeedbackIteratorSetup
Solution
368
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
AnsoftCellInOutEntity
AnsoftForceAndMoment
DataObject
AnsoftForceDataObject
AnsoftHeatLossData Object
AnsoftCellInOutEntity
Solution
AnsoftCellInOutEntity
Table 91: FeedbackIterator
Taskgroup
Task
Input
Output
FeedbackIteratorSetup
FeedbackIteratorEntity
FeedbackIterator
Feedback
Iterator
Task
Input
Output
Turbomachinery
Fluid
Flow
(BladeGen)
(Beta)
Blade
Design
TurboGeometry
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
369
Task
Input
Output
VistaGeometry
Turbo
Mesh
Geometry
CFXMesh
TurboGeometry
FluentImportable
TurboMesh
Setup
CFXMesh
CFXSetup
MechanicalSetup
SystemCouplingSetup Data
SimulationGeneratedMesh
Solution
CFXSetup
CFXSolution
CFXSolution
Results
CFXSolution
CFDAnalysis
FluentSolution
ForteSolution
ICEData
IcePakResults
MechanicalSolution
PolyflowSolutionType
VistaTFSolution
Table 94: Turbo Machinery Fluid Flow
Taskgroup
Task
Input
Output
Geometry
CFXMesh
TurboGeometry
FluentImportable
Turbomachinery
Fluid
Flow
Turbo
Mesh
TurboMesh
Setup
CFXMesh
CFXSetup
MechanicalSetup
SystemCouplingSetup Data
SimulationGeneratedMesh
Solution
CFXSetup
CFXSolution
CFXSolution
370
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Taskgroup
Task
Input
Output
CFXSolution
CFDAnalysis
Results
FluentSolution
ForteSolution
ICEData
IcePakResults
MechanicalSolution
PolyflowSolutionType
VistaTFSolution
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
371
372
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
ACPSetupCellTemplate
Setup
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
ACPResultsCellTemplate
Results
FeedbackIteratorComponentTemplate
Feedback Iterator
ANSYSSetupCellTemplate
Analysis
GeometryCellTemplate
Geometry
AQWAModelCellTemplate
Model
AQWASetupHDCellTemplate
Setup
AQWAAnalysisCellTemplate
Solution
AQWAResultsCellTemplate
Results
GeometryCellTemplate
Geometry
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
373
AQWAModelCellTemplate
Model
AQWASetupHDCellTemplate
Setup
AQWAAnalysisCellTemplate
Solution
AQWAResultsCellTemplate
Results
AUTODYN_Solution
Setup
AUTODYN_Results
Analysis
CFDPostTemplate
Results
CFXPhysicsTemplate
Setup
CFXResultsTemplate
Solution
CFDPostTemplate
Results
GeometryCellTemplate
Geometry
SimulationMeshingModelCellTemplate
Mesh
CFXPhysicsTemplate
Setup
CFXResultsTemplate
Solution
CFDPostTemplate
Results
CFXPhysicsTemplate
Setup
CFXResultsTemplate
Solution
DXDOECellTemplate
Design of Experiments
DXResponseSurfaceCellTemplate
Response Surface
374
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Component Name
DXOptimizationCellTemplate_GDO
Optimization
DXDemoDOECellTemplate
Design of Experiments
DXResponseSurfaceCellTemplate
Response Surface
DXOptimizationCellTemplate_GDO
Optimization
DXCorrelationCellTemplate
DXCorrelationCellTemplate
DXDirectOptimizationCellTemplate
Optimization
DXDOECellTemplate
Design of Experiments
DXResponseSurfaceCellTemplate
Response Surface
DXDOECellForSixSigmaTemplate
DXResponseSurfaceCellForSixSigmaTemplate
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
375
DXSixSigmaCellTemplate
ExternalConnectionTemplate
External Connection
ExternalLoadSetupCellTemplate
Setup
ExternalModelSetupCellTemplate
Setup
FluentTGridCellTemplate
Mesh
FluentSetupCellTemplate
Setup
FluentResultsCellTemplate
Solution
FluentSetupCellTemplate
Setup
FluentResultsCellTemplate
Solution
GeometryCellTemplate
Geometry
SimulationMeshingModelCellTemplate
Mesh
FluentSetupCellTemplate
Setup
FluentResultsCellTemplate
Solution
CFDPostTemplate
Results
ICEMCFD
Model
ICEComponentTemplate
ICE
376
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Component Name
GeometryCellTemplate
Geometry
SimulationMeshingModelCellTemplate
Mesh
ICESetupComponentTemplate
ICE Setup
FluentSetupCellTemplate
Setup
FluentResultsCellTemplate
Solution
CFDPostTemplate
Results
ICEComponentTemplate
ICE
GeometryCellTemplate
Geometry
SimulationMeshingModelCellTemplate
Mesh
ICESetupComponentTemplate
ICE Setup
CFDPostTemplate
Results
IcePakSetupCellTemplate
Setup
IcePakSolutionCellTemplate
Solution
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
Component Display
Name
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_ElectricStaticANSYS
Setup
SimulationSolutionCellTemplate_ElectricStaticANSYS
Solution
SimulationResultsCellTemplate_ElectricStaticANSYS
Results
Component Display
Name
EngDataCellTemplate
Engineering Data
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
377
Component Display
Name
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_StructuralBucklingANSYS
Setup
SimulationSolutionCellTemplate_StructuralBucklingANSYS
Solution
SimulationResultsCellTemplate_StructuralBucklingANSYS
Results
Component Display
Name
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_StructuralBucklingSamcef
Setup
SimulationSolutionCellTemplate_StructuralBucklingSamcef
Solution
SimulationResultsCellTemplate_StructuralBucklingSamcef
Results
Component Display
Name
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_ElectromagneticsMagnetostaticsANSYS
Setup
SimulationSolutionCellTemplate_ElectromagneticsMagnetostaticsANSYS
Solution
SimulationResultsCellTemplate_ElectromagneticsMagnetostaticsANSYS
Results
Component Display
Name
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_StructuralModalANSYS
Setup
SimulationSolutionCellTemplate_StructuralModalANSYS
Solution
SimulationResultsCellTemplate_StructuralModalANSYS
Results
EngDataCellTemplate
Engineering Data
378
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Component Name
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_StructuralModalSamcef
Setup
SimulationSolutionCellTemplate_StructuralModalSamcef
Solution
SimulationResultsCellTemplate_StructuralModalSamcef
Results
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_StructuralModalNASTRAN
Setup
SimulationSolutionCellTemplate_StructuralModalNASTRAN Solution
SimulationResultsCellTemplate_StructuralModalNASTRAN Results
Table 130: Modal (ABAQUS)
Component Name
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_StructuralModalABAQUS
Setup
SimulationSolutionCellTemplate_StructuralModalABAQUS
Solution
SimulationResultsCellTemplate_StructuralModalABAQUS
Results
Component Display
Name
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_StructuralRandomVibrationANSYS
Setup
SimulationSolutionCellTemplate_StructuralRandomVibrationANSYS
Solution
SimulationResultsCellTemplate_StructuralRandomVibrationANSYS
Results
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
379
SimulationSetupCellTemplate_StructuralResponseSpectrumANSYS
Setup
SimulationSolutionCellTemplate_StructuralResponseSpectrumANSYS Solution
SimulationResultsCellTemplate_StructuralResponseSpectrumANSYS Results
Table 133: Topological Optimization (Beta)
Component Name
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_StructuralShapeOptimizationANSYS
Setup
SimulationSolutionCellTemplate_StructuralShapeOptimizationANSYS Solution
SimulationResultsCellTemplate_StructuralShapeOptimizationANSYS Results
Table 134: Shape Optimization (Beta)
Component Name
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_StructuralShapeOptimizationANSYS
Setup
SimulationSolutionCellTemplate_StructuralShapeOptimizationANSYS Solution
SimulationResultsCellTemplate_StructuralShapeOptimizationANSYS Results
Table 135: Static Structural
Component Name
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_StructuralStaticANSYS
Setup
SimulationSolutionCellTemplate_StructuralStaticANSY
S
Solution
SimulationResultsCellTemplate_StructuralStaticANSYS
Results
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_StructuralStaticABAQUS
Setup
SimulationSolutionCellTemplate_StructuralStaticABAQUS
Solution
380
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Component Name
SimulationResultsCellTemplate_StructuralStaticABAQUS
Results
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_StructuralStaticSamcef
Setup
SimulationSolutionCellTemplate_StructuralStaticSamcef
Solution
SimulationResultsCellTemplate_StructuralStaticSamcef
Results
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_ThermalSteadyStateANSYS
Setup
SimulationSolutionCellTemplate_ThermalSteadyStateANSYS
Solution
SimulationResultsCellTemplate_ThermalSteadyStateANSYS
Results
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_ThermalSteadyStateSamcef
Setup
SimulationSolutionCellTemplate_ThermalSteadyStateSamcef
Solution
SimulationResultsCellTemplate_ThermalSteadyStateSamcef
Results
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_ThermalSteadyStateABAQUS
Setup
SimulationSolutionCellTemplate_ThermalSteadyStateABAQUS
Solution
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
381
SimulationResultsCellTemplate_ThermalSteadyStateABAQUS
Results
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_StructuralTransientABAQUS
Setup
SimulationSolutionCellTemplate_StructuralTransientABAQUS
Solution
SimulationResultsCellTemplate_StructuralTransientABAQUS
Results
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_StructuralTransientSamcef
Setup
SimulationSolutionCellTemplate_StructuralTransientSamcef
Solution
SimulationResultsCellTemplate_StructuralTransientSamcef
Results
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_StructuralTransientANSYS
Setup
SimulationSolutionCellTemplate_StructuralTransientANSYS
Solution
SimulationResultsCellTemplate_StructuralTransientANSYS
Results
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_StructuralTransientRBD
Setup
SimulationSolutionCellTemplate_StructuralTransientRBD
Solution
382
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Component Name
SimulationResultsCellTemplate_StructuralTransientRBD
Results
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_StructuralExplicitAUTODYN
Setup
SimulationSolutionCellTemplate_StructuralExplicitAUTODYN
Solution
SimulationResultsCellTemplate_StructuralExplicitAUTODYN
Results
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_ThermalElectromagneticsStaticANSYS Setup
SimulationSolutionCellTemplate_ThermalElectromagneticsStaticANSYSSolution
SimulationResultsCellTemplate_ThermalElectromagneticsStaticANSYS Results
Table 147: Explicit Dynamics (LS-DYNA Export)
Component Name
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_StructuralExplicitLSDYNA
Setup
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_ThermalTransientANSYS
Setup
SimulationSolutionCellTemplate_ThermalTransientANSYS
Solution
SimulationResultsCellTemplate_ThermalTransientANSY
S
Results
EngDataCellTemplate
Engineering Data
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
383
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_ThermalTransientABAQUS
Setup
SimulationSolutionCellTemplate_ThermalTransientABAQUS
Solution
SimulationResultsCellTemplate_ThermalTransientABAQUS
Results
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_ThermalTransientSamcef
Setup
SimulationSolutionCellTemplate_ThermalTransientSamcef
Solution
SimulationResultsCellTemplate_ThermalTransientSamcef
Results
EngDataCellTemplate
Engineering Data
GeometryCellTemplate
Geometry
SimulationModelCellTemplate
Model
SimulationSetupCellTemplate_CustomizableDesignAssessmentANSYS Setup
SimulationSolutionCellTemplate_CustomizableDesignAssessmentANSYS
Solution
SimulationResultsCellTemplate_CustomizableDesignAssessmentANSYSResults
Table 152: Engineering Data
Component Name
EngDataCellTemplate
Engineering Data
MSExcelComponentTemplate
Analysis
SystemCouplingSetupCellTemplate
Setup
SystemCouplingSolutionCellTemplate
Solution
PolyflowSetupCellTemplate
Setup
384
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Component Name
PolyflowSolveCellTemplate
Solution
GeometryCellTemplate
Geometry
SimulationMeshingModelCellTemplate
Mesh
PolyflowSetupCellTemplate
Setup
PolyflowSolveCellTemplate
Solution
CFDPostTemplate
Results
GeometryCellTemplate
Geometry
SimulationMeshingModelCellTemplate
Mesh
PolyflowSetupCellTemplate
Setup
PolyflowSolveCellTemplate
Solution
CFDPostTemplate
Results
PolyflowSetupCellTemplate
Setup
PolyflowSolveCellTemplate
Solution
GeometryCellTemplate
Geometry
SimulationMeshingModelCellTemplate
Mesh
PolyflowSetupCellTemplate
Setup
PolyflowSolveCellTemplate
Solution
CFDPostTemplate
Results
PolyflowSetupCellTemplate
Setup
PolyflowSolveCellTemplate
Solution
GeometryCellTemplate
Geometry
VistaTFSetupTemplate
Setup
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
385
VistaTFSolutionTemplate
Solution
CFDPostTemplate
Results
TSGeometryTemplate
Blade Design
VistaTFSetupTemplate
Setup
VistaTFSolutionTemplate
Solution
CFDPostTemplate
Results
VistaTFSetupTemplate
Setup
VistaTFSolutionTemplate
Solution
386
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Component Name
CFDPostTemplate
Results
TSGeometryTemplate
Blade Design
TSGeometryTemplateBeta
Blade Design
TSMeshTemplate
Turbo Mesh
TSSetupTemplate
Turbo Setup
TSVistaRTDTemplate
Blade Design
TSVistaRTDTemplate
Blade Design
TSVistaCCDTemplate
Blade Design
TSVistaCCDTemplate
Blade Design
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
387
TSVistaCCMTemplate
Performance Map
TSVistaCPDTemplate
Blade Design
TSVistaAFDMeanlineTemplate
Meanline
TSVistaAFDDesignTemplate
Design
TSVistaAFDAnalysisTemplate
Analysis
GeometryCellTemplate
Geometry
TSMeshTemplate
Turbo Mesh
CFXPhysicsTemplate
Setup
CFXResultsTemplate
Solution
CFDPostTemplate
Results
TSGeometryTemplate
Blade Design
TSMTSMeshTemplate
Turbo Mesh
CFXPhysicsTemplate
Setup
CFXResultsTemplate
Solution
CFDPostTemplate
Results
GeometryCellTemplate
Blade Design
SimulationMeshingModelCellTemplate
Mesh
GeometryCellTemplate
Geometry
FESetupCellTemplate
Model
388
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Property
ACPSetupData
ACPFileReference
ACPPreFileReference
AIMFluentMeshOutputProvider
AIMGeometryMeshOutputProvider
AnsoftCADObject
AnsoftHeatLossDataObject
AnsoftTransferXMLString
AnsoftProjectResultsFolderAtCurrentDP
AnsoftForceDataObject
AnsoftTransferXMLString
AnsoftProjectResultsFolderAtCurrentDP
AnsoftForceAndMomentDataObject
AnsoftTransferXMLString
AnsoftProjectResultsFolderAtCurrentDP
FeedbackIteratorEntity
FeedbackIteratorSetup
MAPDLSolution
TransferFile
AuxiliaryFiles
MAPDLDatabse
TransferFile
AuxiliaryFiles
MAPDLResults
AuxiliaryFiles
MAPDLCdb
TransferFile
AuxiliaryFiles
AqwaModel
AqwaSetup
AqwaSolution
AqwaResults
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
389
Property
AutodynSetup
CFDAnalysis
PostStateFile
CFXSetup
CFXSolverInputFile
MAPDLSolverInputFile
CFXSolution
MResLoadOption
CFXResultsFile
AuxiliaryFiles
MAPDLResultsFile
Geometry
GeometryFilePath
PlugInName
ParametricContext
DOEModel
DesignPointsDataTransfer
ResponseSurfaceModel
ResponseSurfaceDataTransfer
OptimizationModel
CorrelationModel
SixSigmaModel
EngineeringData
TransferFile
Material
ExternalConnectionProperties
ExternalDataSetup
TransferFile
ExternalModelOutputProvider
TransferFile
InputFiles
SolidSectionData
TransferFile
AuxiliaryFiles
CompositeSectionFiles
EnhancedMechanicalModel
EnhancedModelData
FEMMesh
390
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Transfer Type
Property
ACMOFile
FEMSetup
FEModelerFile
ANSYSInputFile
ParasolidFile
FiniteElementModelMaterials
AuxiliaryFiles
FluentTGridMesh
TransferFile
FluentSetup
CaseFile
ModelInfoFile
SystemCouplingSetupData
FluentCase
MeshFile
TransferFile
FluentSolution
CaseFile
DataFile
ICEData
ICESetupData
IcePakSetup
IcePakResults
MechanicalModel
File
EdaFile
MeshingGeneratedMeshOutputProvider
PMDBFile
ACMOFile
Mechdb
MeshingMesh
TransferFile
SimulationGeneralMesh
TransferFile
SimulationGeneratedMesh
TransferFile
MSExcelSetup
CouplingSetupProvider
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
391
Property
TransferFile
PolyflowSetup
PolyflowSolutionType
DataFile
PubFile
GeneratedFiles
PolyflowSolution
MechanicalModel
MechanicalMesh
TransferFile
SimulationEngineeringData
TransferFiles
SimulationModelGeneratedMesh
TransferFile
SimulationSetup
MechanicalSetup
TransferFile
MechanicalSolution
SimulationSolutionDataInternal
SimulationSolution
MechanicalResults
SimulationResults
TurboGeometry
INFFilename
GeometryFilename
TurboMesh
FileName
CFXMesh
FileName
PreFileType
FluentImportable
MeshFile
FileType
Dimension
VistaGeometry
GeoData
TransferData
VistaTFPhysics
392
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Transfer Type
Property
TransferData
VistaCCDBladeDesignProvider
TransferData
VistaAFDMeanlineProvider
TransferData
VistaAFDDesignProvider
TransferData
VistaTFSetup
ControlFilename
GeoFilename
AeroFilename
CorrelationsFilename
VistaTFSolution
ResultsFile
RestartFile
AUTODYN_Remap
MatML31
TransferFile
CompositeEngineeringData
TransferFile
FluentMesh
TransferFile
PolyflowTransferMesh
TransferFile
ExternalTraceDataSetup
ForteSetupData
DataFile
ForteSMGData
ForteSolution
ForteSolutionData
Imported FLUENT Mesh File Type
MeshFile
Modeler
SimulationSolutionOutputProvider
GeneralTransfer
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
393
394
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Note
Where listed, a value of "n/a" indicates that you should use an empty format string.
Addin
Data Type
Format
MAPDLCdb
n/a
MAPDLDatabase
n/a
MAPDLSolution
n/a
MAPDLResults
n/a
AQWAModel
AQWASetup
AQWASolution
AQWAResults
AutodynSetup
AutodynAnalysis
CFXSetup
n/a
SystemCouplingSetupData
n/a
CFXSolution
n/a
Geometry
n/a
ANSYS
AQWA
AUTODYN
CFX
DesignModeler
DX
transfer not supported
EKM
No Output Types
Engineering
Data
Engineering Data
materials
ExternalDataSetup
ExternalDataSetup
External Load
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
395
Data Type
Format
ExternalTraceDataSetup
ExternalTraceDataSetup
ExternalModelOutputProvider
ExternalModelOutputProvider
SolidSectionData
n/a
EnhancedModelData
EnhancedModelData
ExternalModelCoupling
FEModeler
Geometry
FEMMesh
ACMOFile
FEMSetup
FacetedGeometry
ParasolidGeometry
InputFile
FiniteElementModelMaterial
Fluent
FluentTGridMesh
n/a
FluentSetup
SystemCouplingSetupData
SystemCouplingSetupData
FluentSolution
n/a
SimulationGeneratedMesh
FluentMesh
ICEMCFD
Imported FLUENT Mesh FileType
CMDBMesh
PolyflowMesh
AnsysMesh
ICEngine
ICEData
ICEData
ICESetupData
n/a
ForteSolution
ForteSolutionData
ForteSMGData
ForteSetupData
n/a
IcePakSetup
IcePakResults
n/a
MechanicalModel
MeshingMesh
CMDBMesh
Forte
IcePak
Meshing
FluentMesh
396
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Addin
Data Type
Format
POLYFLOWMesh
SimulationGeneratedMesh
CMDBMesh
FluentMesh
POLYFLOWMesh
MeshingGeneratedMeshOutputProvider MeshingGeneratedMeshOutputProvider
MSExcel
MSExcelSetup
CouplingSetupProvider
CouplingSetupProvider
PolyflowSetup
PolyflowSolutionType
n/a
PolyflowSolution
ExternalDataSetup
ExternalDataSetup
MechanicalModel
MechanicalMesh
CMDBMesh
Multiphysics
Coupling
Polyflow
Simulation
FluentMesh
POLYFLOWMesh
SimulationGeneratedMesh
CMDBMesh
FluentMesh
POLYFLOWMesh
SimulationEngineeringData
SimulationEngineeringData
SimulationModelGeneratedMesh
SimulationModelGeneratedMesh
SimulationSetup
n/a
MechanicalSetup
n/a
MechanicalSolution
n/a
SimulationSolutionDataInternal
SimulationSolution
SimulationSolutionOutputProvider
SimulationSolutionOutputProvider
SimulationResults
n/a
MechanicalResults
n/a
GeneralTransfer
n/a
VistaGeometry
n/a
TurboMesh
CFXMesh
n/a
FluentImportable
n/a
VistaATFPhysics
n/a
TurboSystem
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
397
Data Type
Format
VistaCCDBladeDesignProvider
n/a
VistaAFDMeanlineProvider
n/a
VistaAFDDesignProvider
n/a
VistaTFSetup
n/a
VistaTFSolution
n/a
AnsoftHeatLossDataObject
n/a
AnsoftGeometryDataObject
n/a
AnsoftCADObject
n/a
AnsoftForceDataObject
n/a
AnsoftForceAndMomentDataObject
n/a
VistaTF
EBU (Q3D,
Maxwell, HFSS)
398
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Tasks
ACP (Pre)
Model
ACP (Post)
Model
Mechanical Model
Model
Electric
Model
Setup
Solution
Eigenvalue Buckling
Model
Setup
Solution
Model
Setup
Solution
Magnetostatic
Model
Setup
Solution
Modal
Model
Setup
Solution
Modal (Samcef )
Model
Setup
Solution
Model
Setup
Solution
Modal (ABAQUS)
Model
Setup
Solution
Random Vibration
Model
Setup
Solution
Response Spectrum
Model
Setup
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
399
Tasks
Solution
Model
Setup
Solution
Model
Setup
Solution
Static Structural
Model
Setup
Solution
Model
Setup
Solution
Model
Setup
Solution
Steady-State Thermal
Model
Setup
Solution
Model
Setup
Solution
Model
Setup
Solution
Model
Setup
Solution
Model
Setup
Solution
Transient Structural
Model
Setup
Solution
Rigid Dynamics
Model
Setup
Solution
Explicit Dynamics
400
Model
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Task Groups
Tasks
Setup
Solution
Thermal-Electric
Model
Setup
Solution
Model
Setup
Solution
Transient Thermal
Model
Setup
Solution
Model
Setup
Solution
Model
Setup
Solution
Design Assessment
Model
Setup
Solution
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
401
402
Release 17.1 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.