ObjectSet.keep


keep(objType, [names])

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

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

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

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

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

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

Remove all objects from this set that do not meet the given criteria Note that keep obeys the value of the downward associativity such that it will also keep the LOFs of any items kept if the downward associativity flag is set true. 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 valuePointer to this objectAllows multiple function calls to be chained together

Example

To build a set that contains only surfaces and that have support "fixed" assigned

 set x = newObjectSet()
 call x.add("Support", "Fixed") ' make the assignments visible
 call x.keep("Surface", "All")  ' make any points lines etc invisible
 
To restrict the view to show only those objects that were already shown, and also have an assignment to aluminium
 call visible.keep("Material", "Aluminium") ' remove objects that do not have this assignment
 
For further syntax examples, see add

Back to ObjectSet

Back to Overview