IMcGraphOverlayItem Property
|
|
Returns one graphic object from the collection based on its ID value or its position, or Nothing if the
object cannot be found.
Namespace:
MediaCy.IQL.Display.Overlays
Assembly:
MediaCy.IQL.Display.Overlays (in MediaCy.IQL.Display.Overlays.dll) Version: 10.0.6912.0
SyntaxReadOnly Property Item (
PositionOrID As Object
) As Object
Get
Parameters
- PositionOrID
- Type: SystemObject
Either a single integral object ID, or a variant containing the
position of an object (a SINGLEPOINT UDT or an array of 2 Single's). The position is given in image coordinates.
If a single integer after a non-default SetEnumFilter, then this is an index into the list of
filtered graph objects. If the index is less than zero or if it is exactly equal to Count, then
the SetEnumFilter is reset to the default and Nothing is returned.
Property Value
Type:
Object
RemarksUnless SetEnumFilter has been called to set some non-default collection Count, then only normal, non-template,
non-label objects (ones with Category mcgewMaster) are found by this method.
Use the GetItemFromDrawingOrder method to find an object based on its DrawingOrder property. To find other objects in
other Categories or based on other properties, use the SetEnumFilter method and then search for the object in a
"ForEach" loop or use this method if you need to avoid a ForEach (see example)
The Item is exposed as Nothing if the specified object could not be found.
Lookup by position may be ambiguous, because multiple objects may overly the same position. Furthermore, since
McGraphObjPoint objects are so small, an initial pass is made through the objects in the reverse of their DrawingOrder
and any McGraphObjPoint found that is very close to the position is returned. If no McGraphObjPoint is found then a
second reverse pass is made to see if any other object intersects the given position. If multiple objects intersect the
given position, then the one with the highest DrawingOrder (i.e., the front-most) will be exposed as the Item.
If the specified item is not found, then Nothing is returned.
Examples
Dim mcgraphoverlayAnnotation As McGraphOverlays
Set mcgraphoverlayAnnotation = ThisApplication.ActiveImage.AnnotationOverlay
mcgraphoverlayAnnotation.SetEnumFilter mcgewSelected + mcgewTemplate, "McGraphObjPoly", mcgtAnyTemplate
Dim nTemplates As Integer = mcgraphoverlayAnnotation.Count
For iT As Integer = 0 to nTemplates-1
Dim goTemplate As McGraphObj = mcgraphoverlayAnnotation.Item(iT)
goTemplate.BorderColor = &HFF0000
Next
mcgraphoverlayAnnotation.SetEnumFilter
See Also