DesignModeler Wizard Definition

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

<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>
	
	<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>
			</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>

	... 
		
</extension>

Understanding the elements <interface> and <simdata> is necessary to understanding the DesignModeler wizard CreateBridge.

Wizard Interface Definition

The element <interface> defines two user interfaces for the extension WizardDemos. The second element <interface> is used by the DesignModeler wizard CreateBridge. This element <interface> has a child element <toolbar> that defines two toolbar buttons for exposure in DesignModeler. When the buttons are clicked, the callback <onclick> executes the functions CreateDeck and CreateSupport, creating a deck geometry with supports.

Simdata Definition

The element <simdata> provides data. This extension has two such elements to provide data for creating the geometries Deck and Support. The second element <simdata> is used by this wizard as it has the attribute context set to DesignModeler.

Wizard Definition

The element <wizard> named CreateBridge in the XML code excerpt has the attribute context set to DesignModeler to indicate that this is the product in which the wizard executes.

Step Definition

The element <step> defines a step in the wizard. This wizard has two steps: Deck and Supports.

  • For the step Deck, the callback <onupdate> executes the function UpdateDeck, creating the deck using the geometry Deck.

  • For the step Supports, the callback <onupdate> executes the function UpdateSupports, creating the bridge supports using the geometry Support.