ObjectSet.exists


exists(objType, [names])

exists(obj, [filterType], [filterNames])

exists(array, [filterType], [filterNames])

exists(attrType, [names], [filterType], [filterNames])

exists(attrType, names, masterSlave, [filterType], [filterNames])

exists(eleType, [filterType], [filterNames])

exists(stressModel, [filterType], [filterNames])

Returns whether or not the given item is present in the set Note that exists ignores the value of the downward associativity such that it will return false if the requested item is not present, even if one of its LOFs is present and the downward associativity flag is set true. This function is exactly equivalent to calling getObjects() and testing to see if the length of the returned array is greater than 0. If you plan to call getObject() conditionally upon the result of a call to exists(), note that it is much more efficient to call getObjects() and check the length of the returned array instead. When called with an ObjectSet or an array, this function acts on all the objects contained within it. When called with attributes, it acts on those objects that have an assignment to the attributes given. In each case, an additional filter can be performed by specifying the type (and optionally name(s)) of objects to be acted on.

objTypestringName of an object type, such as "point", or "line" "Point", "Line", "Element", etc
namesstringName(s)/ID(s) of objects or attributes. Examples are ""bob"", "Structural Support 2", "3", "1T5"
objobjectAn object to act on. Typically another ObjectSet object, or any other object derived from DatabaseMember
arrayarrayAn array of objects derived from DatabaseMember
filterTypestringRestricts operation of this function to only objects of the type given
filterNamesstringRestricts operation of this function to only those objects whose names/IDs are given
attrTypestring "Loading", "Support", "Material", etc
masterSlaveboolean"Master"/true or "Slave"/false
eleTypestringName of a LUSAS element, e.g. "QTS4"
stressModelstringName of a LUSAS stress model e.g. "Thick Shell"
Return valuebooleanreturned true if object(s) were found that matched the input criteria

Example

 call msgbox(visible.exists("Point", 2))
 set p4 = db.getObject("point", 4)
 call msgbox(visible.exists(p4))
 
For further syntax examples, see add

Back to ObjectSet

Back to Overview