Functions and constants relating to Selecting
Details of functionsIsSelected(type_code[integer], item[integer]) [static]DescriptionChecks whether an item has been selected with Select() |
The type of item to select (SOLID, etc.)
If +ve, the internal item number starting at 1. If -ve, the external label of the item.
Returnsboolean Return typeBoolean |
Example
// Returns JS_TRUE if the 1st PART in the model was selected.
if(IsSelected(PART, 1))
{
....
}
|
Pick(type_code[integer], number[integer]) [static]DescriptionAllows the user to interactively pick a specified number of items NOTE: If you are using the WINDOW type code, the function should be seen as "Pick item/model and return it's WINDOW ID" i.e. if you try and use the pick function and click somewhere away from the model, the function will return null. On the other hand, if you click the model then it will return the WINDOW ID in which the model resides. |
The type of item to select (SOLID, etc.)
The number of items to pick.
ReturnsArray of integers Return typeNumber |
Example
// Pick 4 PARTS and return the internal index of each one in array (a) var a = Pick(PART, 4); // Pick 3 NODES and return the external labels of each one in array (b) var b = Pick(NODE, -3);
|
Select(type_code[integer]) [static]DescriptionAllows the user to interactively select items using the mouse or from a menu. |
The type of item to select (SOLID, etc.)
Returnsinteger, >0 the number of items selected, -1 user cancelled the operation, -2 model doesn't contain any of the type requested Return typeNumber |
Example
// Select PARTS interactively and return the number selected. var a = Select(PART);
|