PM_PICK_OBJECT
Syntax
- Input arguments
-
string prompt The prompt shown to the user.
- Optional input arguments
-
int help_id The ID of the help topic to open if the user presses the H key during the pick action. string obj_type1, obj_type2, …, obj_typeN The pickable object types.
- Output arguments
-
int obsolete This argument is obsolete. The argument must be given, but its value is ignored.
Return Values
- Success:
-
handle handle_val Handle of the picked object.
- Failure:
-
int 0 User canceled the operation or nothing was selected.
Description
This function starts the Plant Modeller pick action and returns the handle of the object or group that the user selected. The handle can then be used, for example, to retrieve the properties of the object, or to assign attributes to the object if the user is allowed to modify it. The pick action can be limited to specific object types with optional input arguments.
All supported object types:
-
"3DSPACE"
-
"AIRDUCT" (obsolete, use HVACPART)
-
"ATTRIBUTE"
-
"BEAM"
-
"CABLE"
-
"CABLENETWORKPART"
-
"CABLETRAY"
-
"EQUIPMENT"
-
"GROUP"
-
"HOLEREQUEST"
-
"HULLCONSTRUCTIONPART"
-
"HVACPART"
-
"PIPE" (obsolete, use PIPINGPART)
-
"PIPINGPART"
-
"STANDCMP"
-
"STRUCTCMP"
-
"TEMPGEOM"
-
"WELD"
Examples
Only allow picking an object whose type is "EQUIPMENT" or "PIPINGPART":
obj_h = PM_PICK_OBJECT("Pick the object", obsolete, "EQUIPMENT", "PIPINGPART");
Only allow picking an object whose type is not "EQUIPMENT" or "PIPINGPART":
obj_h = PM_PICK_OBJECT("Pick the object", obsolete, "!", "EQUIPMENT", "PIPINGPART");