select-first-object

Selects the first object matching given criteria. Searches only non-ambiguous objects given the initial selection.

<select-first-object
    type="group_name"
    state="{any | stateless | fully-defined | under-defined | suppressed | 
       not-updated | updated | obsolete | error | bad-license
}"
    name-regexp="regular_expression" />

Note:  It was necessary to “word wrap” the long line of code in the above example.


Attributes

type

Optional. Identifies an object group name or an object type constant as a search criterion. If omitted, the object type is not considered.

Object groups are defined by using the object-group element. Refer to the Standard Object Groups Reference.

Type constants for specific objects (prefixed by "id_") are defined in the script file DSConstants.js.

state

Optional. Specifies an object state as a search criteria. If omitted, the default of "any" is used, meaning that object state is not considered.

States are defined in the script file DSConstants.js.

name-regexp

Optional. Specifies a regular expression of an object's name as a search criterion. For example, "part" matches any object that includes "part" in its name (e.g., "part 2"). If omitted, object names are not considered. See the Microsoft Scripting site under JScript for a regular expressions reference.

Element Information
Parentsactivate-event, if, and, or, not, then, else
ChildrenNone
End TagNo - close element with "/>"
Return ValueTrue if one object meeting the criteria was selected.
See Also

select-all-objects.


Release 18.2 - © ANSYS, Inc. All rights reserved.