You are on page 1of 9

17.

0 Release

Workshop 07: Modify an existing


extension to add a new result
in Mechanical

1 © 2016 ANSYS, Inc. December 13, 2016


Objectives

• Understand the ExtNodeId extension

• Stage-1: Modify the extension to add a new elemental result


– Plot the newly created result (Element Number)

• Stage-2: Modify the extension to add a new nodal result


– Plot the newly created result (node number * x-deformation)

2 © 2016 ANSYS, Inc. December 13, 2016


Understand the ExtNodeId extension (1)
1. Install the ExtNodeId scripted extension
2. Open the nodeIds project
3. Load the ExtNodeId extension and open Mechanical
4. Insert the NodeIds ACT result
– Change the scoped geometry (optional)

3 © 2016 ANSYS, Inc. December 13, 2016


Understand the ExtNodeId extension (2)

4 © 2016 ANSYS, Inc. December 13, 2016


17.0 Release

Stage-1: modify the extension to add an element


result to plot Element Numbers

5 © 2016 ANSYS, Inc. December 13, 2016


Stage 1
• Changes in XML side:
– Copy-paste the <entry> node to add a new button in the toolbar
• Remember to change the name and icon etc.
– Copy-paste the <result> node to add a new result
• Remember to change:
– Name, Icon
– location attribute (from “node” to “element”)
– evaluate callback
• Changes in Python side:
– Copy-paste the onclick function
• Remember to change the name as defined in XML
• Remember to change the result name in CreateResultObject()
– Copy-paste the evaluate function
• Remember to change the name as defined in XML
• Remember that now element IDs are collected and hence change the loop and
make the appropriate changes in the code.
• Reload the extension
Look at the Developer’s Guide for <result> and <property>
Also review: 11-Walkthrough a custom result extension (Workshop-6)

6 © 2016 ANSYS, Inc. December 13, 2016


17.0 Release

Stage-2: Modify the extension to add a node result to


plot (node number * x-deformation)

7 © 2016 ANSYS, Inc. December 13, 2016


Stage 2: XML changes

• Copy the <entry> block


• Make sure to :
• Change the name & icon
• Change the callback

• Copy the <result> block


• Make sure to :
• Change the name, caption, icon
• Add unit attribute
• Change the callback

8 © 2016 ANSYS, Inc. December 13, 2016


Stage 2: Python changes
• Copy the onclick function
• Make sure to :
• Change the name
• Change the result object name

• Copy the evaluate function


• Make sure to :
• Change the name
• Read the “U” result and access it for all
selected nodes
• Set the value for display as the (node
number * x-displacement)
• The results must always be converted
to SI units

9 © 2016 ANSYS, Inc. December 13, 2016

You might also like