How to find selected annotations objects in .NET

Example Requests

How to find selected annotations objects in .NET


Walter 11-02-2008, 23:20
The following snippet of VB.NET code is designed to figure out what annotation objects are selected withing the annotation automation manager. There could be multiple objects being editted, so an AnnGroupObject can be returned when retreiving the object(s) currently being editted in the automation manager.

This code first checks to make sure there is at least one object being editted, and then determines if it's multiple object or just one object. The logic for what to do when an object has been found has been omitted.


Dim group_Of_Objects As AnnGroupObject
Dim singleObject As Object = AnnAutomation.CurrentEditObject

If Not singleObject Is Nothing Then
If TypeOf singleObject Is AnnGroupObject Then
group_Of_Objects = CType(singleObject, AnnGroupObject)
For Each Item As AnnObject In group_Of_Objects.Objects
'Execute methods of the selected objects
Next
Else
' Probably just one object.
' Check for each individual type if necessary.
End
Walter
Technical Support
LEADTOOLS
support@leadtools.com
Copyright LEAD Technologies, Inc. 2009

Powered by Community Server, by Telligent Systems