ACT Customization Guide For Electronics Desktop

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

ANSYS ACT Customization Guide for Electronics

Desktop

ANSYS, Inc. Release 2020 R1


Southpointe January 2020
2600 ANSYS Drive
Canonsburg, PA 15317 ANSYS, Inc. and
ansysinfo@ansys.com ANSYS Europe,
Ltd. are UL
http://www.ansys.com registered ISO
(T) 724-746-3304 9001: 2015
(F) 724-514-9494 companies.
Copyright and Trademark Information

© 2020 ANSYS, Inc. Unauthorized use, distribution or duplication is prohibited.

ANSYS, ANSYS Workbench, AUTODYN, CFX, FLUENT and any and all ANSYS, Inc. brand, product, service and feature
names, logos and slogans are registered trademarks or trademarks of ANSYS, Inc. or its subsidiaries located in the
United States or other countries. ICEM CFD is a trademark used by ANSYS, Inc. under license. CFX is a trademark
of Sony Corporation in Japan. All other brand, product, service and feature names or trademarks are the property
of their respective owners. FLEXlm and FLEXnet are trademarks of Flexera Software LLC.

Disclaimer Notice

THIS ANSYS SOFTWARE PRODUCT AND PROGRAM DOCUMENTATION INCLUDE TRADE SECRETS AND ARE CONFID-
ENTIAL 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. and ANSYS Europe, Ltd. are UL registered ISO 9001: 2015 companies.

U.S. Government Rights

For U.S. Government users, except as specifically granted by the ANSYS, Inc. software license agreement, the use,
duplication, or disclosure by the United States Government is subject to restrictions stated in the ANSYS, Inc.
software license agreement and FAR 12.212 (for non-DOD licenses).

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
ACT Start Page and Tool Access ............................................................................................................... 1
Extension Installation and Loading ......................................................................................................... 2
Electronics Desktop Wizards ...................................................................................................................... 3
Electronics Desktop Wizard Definition ..................................................................................................... 3
Electronics Desktop Function Definition .................................................................................................. 4
Electronics Desktop Wizard Review ......................................................................................................... 6

Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. iii
Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
iv of ANSYS, Inc. and its subsidiaries and affiliates.
Introduction
This guide assumes that you are familiar with the general ACT usage information in the ACT Developer's
Guide. This first section supplies ACT usage information specific to Electronics Desktop:
ACT Start Page and Tool Access
Extension Installation and Loading

While Electronics Desktop does not currently support using ACT to create custom features, it does
support target product wizards. The subsequent section (p. 3) describes how you create target product
wizards for Electronics Desktop.

Note:

For information on all ACT API changes and known issues and limitations that may affect
your existing ACT extensions, see Migration Notes and Known Issues and Limitations in
the ANSYS ACT Developer's Guide.

ACT Start Page and Tool Access


From a stand-alone instance of Electronics Desktop, you access the ACT Start Page by selecting View
→ Wizards.

The ACT Start Page for a stand-alone instance of Electronics Desktop has an icon for accessing the
Extension Manager. However, when Electronics Desktop is opened within Workbench, the ACT Start
Page accessed in this way does not have the icon. This is because you must manage extensions from
the ACT Start Page for Workbench.

Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 1
Introduction

Once accessed, the ACT Start Page and ACT tools are all used as described in the ANSYS ACT Developer's
Guide.

Extension Installation and Loading


For a stand-alone instance of Electronics Desktop, the installation location for an extension with an
Electronics Desktop wizard differs. You must save the extension and associated files to one of the fol-
lowing locations:

• ...\AnsysEM\v201\ACT\win64\syslib\ACT

• Any of the additional folders specified by using the gear icon on the graphic-based Extension Manager ac-
cessed from the ACT Start Page

From the ACT Start Page for the stand-alone instance of Electronics Desktop, you then access the Ex-
tension Manager to load the extension and the Wizards launcher to start the wizard.

Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
2 of ANSYS, Inc. and its subsidiaries and affiliates.
Electronics Desktop Wizards
You can use ACT to create target product wizards for Electronics Desktop. The supplied extension
WizardDemo includes a target product wizard for Electronics Desktop named Wizard Demo. This
two-step wizard creates two geometries from three dimension properties and the addition of two
boundary conditions:
Electronics Desktop Wizard Definition
Electronics Desktop Function Definition
Electronics Desktop Wizard Review

Note:

You use the Extension Manager to install and load extensions and the Wizards launcher to
start a target product wizard.

Tip:

Included in the supplied package ACT Wizard Templates is the extension Template-
ElectronicsDesktopWizard. It includes a target product wizard for Electronics Desktop
that displays a list of available projects or designs and creates a cube. For download inform-
ation, see Extension and Template Examples.

Electronics Desktop Wizard Definition


The file WizardDemo.xml follows. For both the elements <extension> and <wizard>, the attribute
context is set to ElectronicsDesktop.
<extension name="Wizard Demo" version="1">
<author>ANSYS Inc.</author>
<guid shortid="ElectronicsWizard">819d1fd2-17c2-493a-ad6a-ee608356229a</guid>
<script src="callbacks.py" />

<interface context="ElectronicsDesktop">
<images>images</images>
</interface>

<wizard name="Wizard Demo" caption="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=
<property control="float" name="height" caption="Height" persistent="False" parameterizable="False" defaul
</propertygroup>

<propertygroup name="offset" caption="Offset for duplication (mm)" persistent="False" parameterizable="False


<property control="float" name="offset" caption="Offset" persistent="False" parameterizable="False" defaul
</propertygroup>

Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 3
Electronics Desktop Wizards

<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="
<property control="float" name="reactance" caption="Full Reactance" persistent="False" parameterizable="Fa
</propertygroup>

<callbacks>
<onupdate>OnUpdate2</onupdate>
</callbacks>

</step>

</wizard>
</extension>

Step Definition
The element <step> defines a step in the wizard. This wizard has two steps: Step1 and Step2.

• In the first step, the first two dimensions define and create a rectangle. The first rectangle is then auto-
matically duplicated and set at an offset along the Y axis, which is defined by the third dimension.

• In the second step, two boundary conditions are automatically created.


For each step, the element <callbacks> specifies callbacks to functions defined in the script call-
backs.py. For property and callback descriptions, see Electronics Desktop Wizard Review (p. 6).

Electronics Desktop Function Definition


The IronPython script callbacks.py follows. This script defines all functions executed by the callbacks
in the steps for the Electronics Desktop wizard Wizard Demo.
# ----------------------------------------------
# Callbacks
# ----------------------------------------------

oDesign = None
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",

Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
4 of ANSYS, Inc. and its subsidiaries and affiliates.
Electronics Desktop Function Definition

"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",
"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)",

Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 5
Electronics Desktop Wizards

"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"
])

Electronics Desktop Wizard Review


This section reviews the wizard interface and the processes performed in each step of the wizard Wizard
Demo.

The first step is Design, which defines the geometries.

Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
6 of ANSYS, Inc. and its subsidiaries and affiliates.
Electronics Desktop Wizard Review

In this step:

• Two property groups define the three dimension properties.

– The first property group Dimensions includes the properties Width and Height for creating the first
rectangle.

– The second property group Offset for duplication, includes the property Offset for duplicating
the first rectangle.

• Two callbacks are defined:

– The callback <onupdate> invokes the function OnUpdate1 when Next is clicked. 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 callback <onreset> is invoked when Back is clicked in step 2. This button is enabled only if the
callback <onreset> has been defined.

The next step is Setup, which defines and applies the boundary conditions.

In this step:

• The property group for boundary conditions defines two properties: Full Resistance and Full Re-
actance.

• The callback <onupdate> invokes the function OnUpdate2 when Next is clicked. This function applies
the boundary conditions to both rectangles.

Once the wizard has completed, the boundary conditions can be viewed in Electronics Desktop by se-
lecting them in the Project Manager tree.

Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates. 7
Electronics Desktop Wizards

Release 2020 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential information
8 of ANSYS, Inc. and its subsidiaries and affiliates.

You might also like