Input Keyword

Definition

Enables you to declare a value to be entered by the end-user. Before the document is generated, a dialog box is displayed and the user is required to enter a value for each piece of data declared as an input. 

The Input keyword may be used in two different contexts:

  •  
 
If you want a user input to be required, use the following syntax:
Input:type_of_the_needed_input 
Example: Input:Feature or Input:Length or Input:FilePath 

A user input may be required in the following cases:

  •  
To define the context of the script: context Input:Feature "Specify the context"
  •  
To valuate an attribute: X = 10, Input:Length "Enter the value"; or RefPlane = object: Input:Feature "Specify the reference plane";
  •  
To valuate a name: PartBody, Input:Name "Enter the body name" isa BodyFeature
  •  
To define an import: import Input : FilePath "Enter the file name";
  •  
To valuate a local variable: let X = Input : Feature "First Point to use";

 

  •  
 
If you want to re-use a local variable.

Example:

let X = Input : Feature "First Point to reuse";
let Y = Input : Feature "Second Point to reuse";
....
L isa GSMLine
{
               LineType = 0;
               TypeObject isa GSMLinePtPt
               {
                            FirstPoint = object: Input X; //X and Y are local 
                            SecondPoint = object: Input Y; // variables

        }

} ...

//

Here is the list of data that can be declared as an input:

Data  type
parameter  parameter type as declared in f(x)
file paths FilePath
feature names Name
edges when they are used to create features like chamfers or fillets Edge
points when they are used to create holes Point
features Feature
faces Face
axes  Axis
length Length

Syntax

DataName = DefaultValue, Input: DataType "Comment"

or 

DataName = DefaultValue, Input: DataType In: 'value1,value2,...';

where:

 
  • DataName is the name of the data whose value is to be entered by the end-user.
 
  • DefaultValue is the default value to be displayed in the "Enter Inputs" dialog box.
 
  • DataType is the type of the data whose value is to be specified (see above).
 
  • valuei is one of the values of a multiple value data.

Example 

When the script below is executed:

myDocument isa CATPart
  {
    myPart isa Part
      {
        PartBody isa BodyFeature
          {
            L = 3.6 mm , Input: Length "Enter the pad length";
            X = 6.6 mm , Input: Length "Select a value in the list" In : `6.6mm,12 mm,100mm,3.3m` ;
            FeatureName = "Part1" , In : `Part1,Part2,Part3`;
          }
      }
  }

The following dialog box is displayed:

 
  • The L and X values are to be entered by the user.
 
  • The L default value is set to 3.6mm. If you want to modify this value, select the L line, modify the value in the 'L=' field then click Apply. The X line is then highlighted and the 'X=' field displays a four-value list.

 

Select one of these values, click Apply then click OK to execute the script and generate the document.

The FeatureName parameter which is a multiple value parameter is created in the specification tree. 

You can edit it to check the list of possible values.