This following example script requires that you first load a
model:
# Get Active model handle
::post::GetActiveModelHandle m
# Create an element selection set and add element 100,
# then add adjacent
m GetSelectionSetHandle eset [m AddSelectionSet element]
eset Add "id == 100"
eset Add adjacent
# Get a query control, set the selection set, then define
# the query. The query consists of a dot notation containing
# DATASOURCE.FIELD. Data sources can be listed by calling
# GetDataSourceList, properties for a particular data source
# can be listed by calling GetDataSourceFieldList and passing
# the data source to list fields for:
# qc GetDataSourceList returns "node element component ..."
# qc GetDataSourceFieldList element returns "id config compid ..."
m GetQueryCtrlHandle qc
qc SetSelectionSet [eset GetID]
qc SetQuery "element.id element.connectivity"
# once the query has been set and the selection set has been assigned
# to the query control, the data can be extracted by retrieving an iterator
# and cycling through all the items in the set and calling GetDataList.
qc GetIteratorHandle qciter
for {qciter First} {[qciter Valid]} {qciter Next} {
puts [qciter GetDataList]
}
# Release all handles
qciter ReleaseHandle
qc ReleaseHandle
eset ReleaseHandle
m ReleaseHandle