AnnGetSelectList example for Visual J++

Note: This topic is for Document/Medical only.

This example gets the number of selected annotation objects; then it gets an array of the selected object handles and checks to see if any of the objects in the array are polygons.

short sCount = LEAD1.AnnGetSelectCount();  // get number of selected objects
MessageBox.show( sCount + " objects were selected" );
Variant aObjects = LEAD1.AnnGetSelectList();  // get the handles of the selected objects
boolean bSelected = false;
for( int a = 0 ; a < sCount ; a++ )
{
   short sType = LEAD1.AnnGetType( aObjects.toSafeArray().getInt( a ) );
   if( sType == LTOCXU.AnnObjectConstants.ANNOBJECT_POLYGON )  // Is the object a 
olygon?
      bSelected = true;
}

if( !bSelected )
   MessageBox.show( "No Polygon Objects were selected" );