Ugrás a fő tartalomhoz
Verzió: 17

GET_USER_INPUT

Requests input from the user during the script run.

Description

With the GET_USER_INPUT command various types of input data can be requested from the user during the script run. Each individual input request is a new line directly after the GET_USER_INPUT line, except for the OPTION input type, which can take up several lines. One GET_USER_INPUT command will generate one dialogue window, with all the input fields listed. An arbitrary number of inputs can be requested within one GET_USER_INPUT command, but it is advised to take into account the available screen space for the dialogue window that will be generated.

After the user defined all the requested inputs and clicked on the "OK" button, the given values will be saved into their respective variables, and the script run will continue.

Additionally to input inquiries, images can be inserted into the dialogue window. This is typically useful in case there is some explanation needed for the input request in the form of a drawing or a picture.

Syntax

GET_USER_INPUT
TEXT [Variable name] [Dialogue text] [Default value]
NUMBER [Variable name] [Dialogue text] [Default value]
BOOL [Variable name] [Dialogue text] [Default value]
OPTION [Variable name] [Dialogue text] [Default value]
[Option 0 value] [Option 0 dropdown text]
[Option 1 value] [Option 1 dropdown text]
[Option 2 value] [Option 2 dropdown text]
ENDOPTION
POINT [Array name] [Dialogue text]
OBJECT [Array name] [Dialogue text] [Object type]
FILE_PATH [Variable name] [Dialogue text] [Default value]

Input types

One or more input types can be requested within one GET_USER_INPUT command in arbitrary order.

Available input types:

Input typeDescription
TextText input
NumberNumerical input
BoolBoolean input
OptionOption choice from dropdown
Pointx,y,z coordinates of a point selected in the model
ObjectObject IDs of model objects selected in the model
File pathFile path input with file open button

Sample code

GET_USER_INPUT
TEXT TextVariable "Text input" textdefault
NUMBER NumberVariable "Numerical input" 12345
BOOL BoolVariable "Bool input" True
OPTION OptionVariable "Dropdown option" 1
Opt_Value0 "Option 0"
Opt_Value1 "Option 1"
Opt_Value2 "Option 2"
ENDOPTION
POINT PointArray "Point select"
OBJECT ObjectArray "Object select"
FILE_PATH file_path "File path"

The above code will result in this input dialogue:


Detailed description of input types

Text input

Syntax

GET_USER_INPUT
TEXT [Variable name] [Dialogue text] [Default value]

Command parameters

Command parameterAssignmentValue formatInput options
Variable nameRequiredStringLocal, variable
Dialogue textRequiredStringLocal, variable
Default valueOptionalStringLocal, variable

Variable name:

Name of the variable that will contain the requested input.

Dialogue text:

Text that will appear on the dialogue window.

Default value:

Default value of the requested input variable.

Sample code

GET_USER_INPUT
TEXT TextVariable "Text input" textdefault

The above code will result in this input dialogue:

Numerical input

Syntax

GET_USER_INPUT
NUMBER [Variable name] [Dialogue text] [Default value]

Command parameters

Command parameterAssignmentValue formatInput options
Variable nameRequiredStringLocal, variable
Dialogue textRequiredStringLocal, variable
Default valueOptionalInteger, floatLocal, variable

Variable name:

Name of the variable that will contain the requested input.

Dialogue text:

Text that will appear on the dialogue window.

Default value:

Default value of the requested input variable.

Sample code

GET_USER_INPUT
NUMBER NumberVariable "Numerical input" 12345

The above code will result in this input dialogue:

Boolean input

Syntax

GET_USER_INPUT
BOOL [Variable name] [Dialogue text] [Default value]

Command parameters

Command parameterAssignmentValue formatInput options
Variable nameRequiredStringLocal, variable
Dialogue textRequiredStringLocal, variable
Default valueOptionalPredefined stringsLocal, variable

Variable name:

Name of the variable that will contain the requested input.

Dialogue text:

Text that will appear on the dialogue window.

Default value:

Default value of the requested input variable.

Accepted inputs:
  • Positive: "True" or "1"
  • Negative: "False" or "0"

Sample code

GET_USER_INPUT
BOOL BoolVariable "Bool input" True

The above code will result in this input dialogue:

Option input

The option input creates a dropdown list on the dialogue, from where the user can choose 1 option.

There are 2 ways to set up an option input:

Option input defined by local list

One option input takes up several rows within the GET_USER_INPUT command. After the line starting with "OPTION" all dropdown options have to be listed in separate rows. After the row of the last dropdown option, the "OPTION" input is closed with an additional "ENDOPTION" line.

Syntax

GET_USER_INPUT
OPTION [Variable name] [Dialogue text] [Default value]
[Option 0 value] [Option 0 dropdown text]
[Option 1 value] [Option 1 dropdown text]
[Option 2 value] [Option 2 dropdown text]
etc.
ENDOPTION

Command parameters

Command parameterAssignmentValue formatInput options
Variable nameRequiredStringLocal, variable
Dialogue textRequiredStringLocal, variable
Default valueOptionalIntegerLocal, variable
Option valuesRequiredStringLocal, variable
Option dropdown textsRequiredStringLocal, variable

Variable name:

Name of the variable that will contain the chosen option value.

Dialogue text:

Text that will appear on the dialogue window.

Default value:

Number of the default input option. The numbering of the options starts with 0.

Option values:

The values associated with the individual dropdown options. If a certain option is selected, then its value will be assigned to the resulting variable of the option input.

Option dropdown texts:

Text that will appear within the dropdown of the dialogue window.

Sample code

GET_USER_INPUT
OPTION OptionVariable "Dropdown option" 1
Opt_Value0 "Option 0"
Opt_Value1 "Option 1"
Opt_Value2 "Option 2"
ENDOPTION

The above code will result in this input dialogue:

Option input defined by arrays

With this syntax, the value and text for the items in the dropdown list are given by 2 arrays. These arrays must be the same size. This syntax allows to create dropdown lists with a number of items that are not known at the time of coding.

Syntax

GET_USER_INPUT
OPTION [Variable name] [Dialogue text] [Value array] [Text array] [Default value]

Command parameters

Command parameterAssignmentValue formatInput options
Variable nameRequiredStringLocal, variable
Dialogue textRequiredStringLocal, variable
Value arrayRequiredStringLocal, variable
Text arrayRequiredStringLocal, variable
Default valueOptionalIntegerLocal, variable

Variable name:

Name of the variable that will contain the chosen option value.

Dialogue text:

Text that will appear on the dialogue window.

Value array:

An array that contains the corresponding values for each item in the dropdown list.

Text array:

An array that containst the texts that will be shown in the dropdown UI element for each list item.

Default value:

Number of the default input option. The numbering of the options starts with 0.

Sample code

ARRAY_CREATE Value_array
ARRAY_ADD Value_array Value1
ARRAY_ADD Value_array Value2
ARRAY_ADD Value_array Value3

ARRAY_CREATE Static_Text_array
ARRAY_ADD Static_Text_array "Option 1"
ARRAY_ADD Static_Text_array "Option 2"
ARRAY_ADD Static_Text_array "Option 3"

GET_USER_INPUT
OPTION Output_Var "Dropdown option" Value_array Static_Text_array 1

The above code will result in this input dialogue:

Point input

With the point input a selection of a point can be requested from the user. The coordinates of this point will be stored in an array.

Syntax

GET_USER_INPUT
POINT [Array name] [Dialogue text]

Command parameters

Command parameterAssignmentValue formatInput options
Array nameRequiredStringLocal, variable
Dialogue textRequiredStringLocal, variable

Array name:

Name of the array that will contain the coordinates of the selected point.

Dialogue text:

Text that will appear on the dialogue window.

Sample code

Command only:

GET_USER_INPUT
POINT PointArray "Point select"

The above code will result in this input dialogue:

The steps of the selection are the following:

  • Click on the select button on the dialogue window
  • Click on the point in the model
  • Click on OK

Command + coordinate check:

GET_USER_INPUT
POINT PointArray "Point select"

Object input

Syntax

GET_USER_INPUT
OBJECT [Array name] [Dialogue text] [Object type]

Command parameters

Command parameterAssignmentValue formatInput options
Array nameRequiredStringLocal, variable
Dialogue textRequiredStringLocal, variable
Object typeOptionalPredefined stringsLocal, variable

Array name:

Name of the array that will store the IDs of the selected objects.

Dialogue text:

Text that will appear on the dialogue window.

Object type:

Restricts the selectable object types to 1 type.

Available object types:
Object type nameObject type
Geometry tab-
PointPoint
LineLine
ArcCircleArc
Two-dimensional figurePolygon
Dimension lineDimension_Line
Dimension radius and diameterDimension_Radius
Dimension arcDimension_Arc
Dimension angleDimension_Angle
Dimension heightDimension_Height
Dimension textboxDimension_Textbox
Structural members tab-
MemberStructural_Member
PlateStructural_Plate
DiaphragmStructural_Diaphragm
Rigid bodyStructural_RigidBody
HaunchHaunched_Member
Point supportSupport_Point
Line supportSupport_Edge
Surface supportSupport_Plate
Shear fieldShearField
LinkLink
Smart linkSmartLink
Purlin linePurlinLine_Place
Purlin overlap and support zonePurlinJoint_Place
Rectangular cutoutHole_Rec
Circular cutoutHole_Circ
Hexagonal cutoutHole_Hex
Perpendicular plate stiffenerStiffener_PlatePerp
Parallel plate stiffenerStiffener_PlatePar
Perpendicular section stiffenerStiffener_Section
Placed jointJoint_Place
Loads tab-
Point loadNodeForce
Line loadMemberForce
Line wind loadLineWindForce
Surface loadPlateForce
Load transfer surfaceLoadTransferSurface
Line temperature loadMemberThermal
Surface temperature loadPlateThermal
Prescribed displacementPresDisp
Change in lengthElongation
Tension forcePretension
Influence lineMovingLoadPath
Wind surfaceWindSurface
Snow surfaceSnowSurface
Surface wind loadSurfWindForce
Surface snow loadSurfSnowForce
Fire loadMemberFireEffect
Mass tab-
Node massNodeMass
Finite element tab-
ConstraintStructural_Constraint
Stiffener warping supportStiffener_Warping_Support

Sample code

Command only:

GET_USER_INPUT
OBJECT ObjectArray "Object select"

The above code will result in this input dialogue:

The steps of the selection are the following:

  • Click on the select button on the dialogue window
  • Select objects in the model
  • End the selection with a right click
    The window after this step should look like this:

  • Click on OK

Command + object ID check:

GET_USER_INPUT
OBJECT ObjectArray "Object select"

Command with optional object type parameter + object ID check:

GET_USER_INPUT
OBJECT ObjectArray "Select structural members" Structural_Member

ARRAY_GET ObjectArray 0 Obj_ID1
GET $Obj_ID1 Name Obj_name

File path input

The file path input is similar to the text input, but with an additional file open button on the right side of the input field. After clicking the file open button, a file explorer window will open, where a file can be selected and opened, which copies the file path into the input field. Alternatively a file path can also be typed or pasted into the input field.

Syntax

GET_USER_INPUT
FILE_PATH [Variable name] [Dialogue text] [Default value]

Command parameters

Command parameterAssignmentValue formatInput options
Variable nameRequiredStringLocal, variable
Dialogue textRequiredStringLocal, variable
Default valueOptionalStringLocal, variable

Variable name:

Name of the variable that will contain the requested input.

Dialogue text:

Text that will appear on the dialogue window.

Default value:

Default value of the requested input variable.

Sample code

GET_USER_INPUT
FILE_PATH file_path "File path"

The above code will result in this input dialogue:

Additional content on dialogue window

Picture

Images can be inserted into the dialogue window generated by the GET_USER_INPUT command. This is typically useful in case there is some explanation needed for the input request in the form of a drawing or a picture.

Syntax

GET_USER_INPUT
IMAGE [File path]

Command parameters

Command parameterAssignmentValue formatInput options
File pathRequiredStringLocal, variable

File path:

Path, file name and extension of the image.

Sample code

Command only:

GET_USER_INPUT
IMAGE c:\Temp\Sample_Picture.png

Image + all possible input types:

GET_USER_INPUT
IMAGE c:\Temp\Sample_Picture_v02_Wide.png
TEXT TextVariable "Text input" textdefault
NUMBER NumberVariable "Numerical input" 12345
BOOL BoolVariable "Bool input" True
OPTION OptionVariable "Dropdown option" 1
Opt_Value0 "Option 0"
Opt_Value1 "Option 1"
Opt_Value2 "Option 2"
ENDOPTION
POINT PointArray "Point select"
OBJECT ObjectArray "Object select"
FILE_PATH file_path "File path"

The above code will result in this input dialogue: