|
Define a Method
-
In the Technological Object toolbar, click the
Add Function/Method icon ().
The Method or Function Creation window opens.
-
Enter the Method name, GetDiameter in this scenario, in
the Method Type field.
-
Click Method in the Function/Method
Selection frame.
-
Click the ... button in the Method Type
field and select the type, Hole in this scenario, that will be returned
in the Choose Type Argument dialog box. Click OK
when done.
-
Click the ... button in the Argument(s)
field. The Choose Type Argument dialog box is displayed.
-
Enter the name of the argument in the Name of
Argument field, DiameterType.
-
In the Type of Argument frame, click
Simple type and select String from the list. Click
OK when done.
-
Click the ... button in the Return Type
field. The Choose Type Argument dialog box is displayed.
-
click Simple type and select LENGTH
from the list. Click OK when done.
-
Enter the body in the editor.
if (DiameterType == "Normal")
ReturnParm = This.Diameter
else
ReturnParm = This.DiameterThread |
You are done with the definition of the method.
-
Click OK when done. The method is created and
displayed below the Function/Method View node.
|
When you define a method on a
given type, it is displayed below this type in the Knowledge Expert
browser. |
Define a Function
-
In the Technological Object toolbar, click the
Add Function/Method icon ().
The Method or Function Creation window opens.
-
Enter the name of the function that you want to create, (myGetDiameter)
in the Name of Interactive Function field.
-
Click the ... button in the Argument(s)
field. The Choose Type Argument dialog box is displayed.
-
Enter the name of the argument in the Name of
Argument field, H in this example.
-
In the Type of Argument frame, select
Hole from the list. Click OK when done.
-
Click the ... button in the Return Type
field. The Choose Type Argument dialog box is displayed.
-
click Simple type and select LENGTH
from the list. Click OK when done.
-
Enter the body in the editor. Note that Diameter is one
of the attributes of the hole type, which enables you to retrieve it.
You are done with the definition of the method.
-
Click OK when done. The method is created and
is displayed below the Function/Method View node
|