|
|
|
|---|
Tutorial: check and resolution calculations
![]()
Introduction:
Before beginning any wizard, you have to clearly define the purpose as well as the principal steps to cross..
In this tutorial, you are going to create a calculation wizard. This one is available from the TopSolid standard wizards (Assembly | Execute standard wizard) : family "calculations", type "shear" and variant "pin". It allows you to check and to calculate the ideal dimensions of a pin subjected to a shearing force.
The check calculation gives you the minimal diameter to respect according to the forces apply on it in order to check that the pin you use is really suited. The resolution calculation gives you the maximal load applicable to a pin (you have to know its size and its material) or the material to use according to the size and load or the minimal diameter to respect.
The shear conditions (load and resistance to slipping) will have to be define during the execution of the wizard.
Once the wizard finished, its model document will be similar to this
one :
.
New TopSolid/Wizard document:
Open a new TopSolid/Wizard document : File | New function or icon
.
Select the wizard tab and select the OK button. You have now an empty TopSolid/Wizard document.
You have to save your work regularly.
You can save this document right now. Create a first folder in Missler\Config and name it My wizards. This one is the standard of your wizard. In this folder, create another one and name it Tutorial, it is the family of your wizard.
You have to declare the folder My wizards as a standard. For that, use the following keyword in your top.cfg file :
D_COMPO_WIZARD_STANDARD <tab> My wizards <tab> folder path.
This way, you will be able to execute your wizard thanks to the "Assembly | Execute standard wizard" function of a TopSolid/Design document.
Then, in your TopSolid/Wizard document, use the "File | Save"
function or icon
et and save your file in the Tutorial
folder created before. Give the following name to your file : shear#V=check#I=00#R=NR (shear
is the type name and check
the variant name)
Simple click on this same icon will allow you to save your document regularly.
Variables creation:
When you create a wizard, variables are often created progressively. However, some of them can be created right now.
In this wizard, you have to differentiate the calculation type : check calculation or resolution calculation. For that, you have to create an enumeration variable and name it calculation_type. To differentiate the shear type (simple or double) you have to create another enumeration variable and name it shear_type.
The check calculation gives you the minimum diameter of the pin according to the forces apply on it. The force are the load and the resistance to slipping. For that, you have to create three real variables (name them d, T and Rpg)
For the resolution calculation, you have to know :
Load + resistance to slipping.
Load + diameter.
Diameter +resistance to slipping.
To differentiate these three possible combinations you have to create an enumeration variable, name it values.
Nodes creation:
Node
n°1 : Root node
Each wizard must begin by a root node. Place it at the top of your document.
Node
n°2 : Dialog page node
Behind this node, you are going to differentiate the calculation type. For that, place a dialog page node in which you will use radio buttons corresponding to the "calculation_type" enumeration variable.
It is your first dialog page, you must define it in the properties of the page (File | Properties in TopSolid/Dialog). This way, the < Previous .button will be grey. The others dialog pages will have to be define as medium page or last page.
During the execution of the wizard, your page could be as following :
Click on the image to get more details

Node
n°3 : Dialog page node
In this node, you will choose the shear type of the pin (simple or double). Create a dialog page where you will use radio buttons of the "shear_type" variable. In order to illustrate the shear type you can use some images in your node.
Click on the image to get more details

Node
n°4 : Switch node
Now you have to direct the wizard according to the type of calculation selected in the node n°2.
You must create a switch node using the "calculation_type" variable.

Check calculation:
Consider the case where calculation type selected in node n°2 is check calculation.
Resolution calculation will be consider later.
Node
n°5 : Dialog page node
Create a dialog page node in order to give value to the resistance to slipping and to the load.
Click on the image to get more details

Node
n°6 : Switch node
You have now the data to make the check calculation.
Before that, you have to place a switch node to direct the wizard to the calculation corresponding at the shear type selected in node n°3 (simple or double shear).

Node
n°7 and 8 : Computing node
You can place your computing node which computes the minimal diameter of the pin according to the forces apply on it.

For the double shear, you just have to change the expression. It becomes : d=sqrt((2*T)/(PI*Rpg)).
Node
n°9 : Dialog page node
It is enough to display the result of the previous node. You have to use a dialog page node.
Click on the image to get more details

Resolution Calculation:
The check calculation is finished. Now, you are going to make the resolution calculation from node n°4.
Node
n°10 : Dialog page node
Create a dialogue page node in order to give value to the real variables create before (T, Rpg and d).
You will use radio buttons to direct the wizards to the good computing node according to the selected radio button.
Click on the image to get more details

You have the possibility to add events to your dialog page node. This way, you will be able to grey a field according to the selected radio button.
Node
n°11 : Switch node
You have now the data to make the resolution calculation.
Before that, you have to place a switch node to direct the wizard to the calculation corresponding at the shear type selected in node n°3 (simple or double shear).

Node
n°12 and 13 : Computing node
The two computing nodes to place after the switch node allow you to give to a real variable (name it x) the "1" value for a simple shear or the "2" value for a double shear.
Computing node example for the simple shear :

Node
n°14 : Switch node
Now, you have to direct the wizard to the computing node corresponding to the radio button selected at the node n°10.
This thanks to a switch node :

Node
n°15, 16 and 17 : Computing node
Compute example if the known values are the load and the resistance to slipping (first radio button of the node n°10).

If the known values are the load and the diameter, the expression of the second computing node becomes : Rpg=(4*T)/(x*PI*d*d)
If the known values are the diameter and the resistance to slipping, the expression of the third node becomes : T=(Rpg*x*PI*d*d)/4
Node
n°18, 19 and 20 : Dialog page node
It is time to display the result of calculations using three different dialog page nodes.
Click on the image to get more details
Diameter result :

Resistance to slipping result :

Load result :

Node
n°21 : Finish node
Your wizard is finished, you can create a finish node and connect your last nodes on it.
Execute wizard:
To execute your wizard, you have two possibilities :
If you have declare your My Wizards folder as a standard (cf backup paragraph of this tutorial), you can execute your wizard using the Assembly | Execute standard wizard function.
You can use the Assembly | Execute wizard function and select the wizard to execute thanks to the explore button or selecting the .wiz file if it is opened.