For an overview and a list of Spatial Search functions, see Spatial Searches.
The functions described in this section allow for spatial searches of structure networks. The portion of the structure network to be searched is specified, and a set of filters much like the invisibility and highlight filters are specified to limit the set of eligible primitives. A search aperture is also specified. The first output primitive that satisfies the filter criteria and is within the search aperture is returned.
For an overview and a list of Spatial Search functions, see Spatial Searches.
A search context is a PEX resource that contains all of the search criteria to be used when spatially searching a structure network. Two of the attributes that specify search criteria contain name set resource identifiers. If name sets are created, bound to a search context, then freed, the contents of the name sets remain, because they are still referenced by the search context. However, if the search context is queried, the value PEXAlreadyFreed is returned for any such freed name sets, because they no longer have valid resource identifiers by which they can be referenced.
A search context resource contains the following attributes. All attributes became available with PEX 5.0, except text font table, which became available in PEX 5.2:
Use the PEXSearchNetwork function to perform a search operation once all of the search criteria attributes have been established. To search, the structure network specified is conceptually traversed starting at the element following the element specified by the start path. Each output primitive is transformed to world coordinates and compared against the search aperture to determine proximity. For text and annotation text primitives, only the transformed origin of the text string is used to determine proximity. If the transformed primitive's geometry places it within the search aperture, its name set attribute is checked against the normal list and against the inverted list to determine eligibility.
The search is successful if an output primitive is found which satisfies the search filter criteria and is within the search aperture. The path to the first such primitive found is returned, and the start path attribute of the search context is set to the found path. This allows the next search operation on the same search context to continue from just after the found primitive.
If no such primitive is found before the end of the structure indicated by the search ceiling is reached, then the search is unsuccessful, NULL is returned as the found path, and the start path attribute is not changed.