Mechanical Wizard Definition

The file WizardDemo.xml follows.

An excerpt from the file WizardDemos.xml follows. Code is omitted for the element <uidefinition> and all wizards other than the Mechanical wizard SimpleAnalysis.

<extension version="2" minorversion="1" name="WizardDemos">
	<guid shortid="WizardDemos">7fdb141e-3383-433a-a5af-32cb19971771</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" />
	<script src="sc.py" />
	
	<interface context="Project|Mechanical|SpaceClaim">
		<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">
				<callbacks>
					<onclick>CreateSupport</onclick>
				</callbacks>
			</entry>
		</toolbar>
	
	</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>
		
	... 
		
</extension>

Wizard Interface Definition

The element <interface> defines two user interfaces for the extension WizardDemos. The first element <interface> is used by the Mechanical wizard SimpleAnalsyis.

Wizard Definition

The element <wizard> named SimpleAnalsyis has the attribute context set to Mechanical to indicate that this is the product in which the wizard executes.

Step Definition

The element <step> defines a step in the wizard. This extension has three steps: Mesh, Solution, and Results.

  • For the step Mesh, the callback <onreset> executes the function RemoveControls to clear existing mesh controls. The callback <onupdate> executes the function CreateMeshControls to create new mesh controls.

  • For the step Solution:

    • The callback <onrefresh> executes the function RefreshLoads to initialize various properties, including the number of nodes, number of elements computed in the previous step, and so on.

    • The callback <onreset> executes the function RemoveLoads to clear loads.

    • The callback <onupdate> executes the function CreateLoads to create new loads, create new results, and perform the solve.

  • For the step Results, the callback <onrefresh> executes the function RefreshResults to fill the property value associated with the result of the computation (Maximum of Total Deformation).