OnAnnSelect example for Delphi
//This example for the OnAnnSelect event displays a message box showing the number of
//selected annotation objects. It then goes through the array of selected objects
//to see if any of them are polygons.
procedure TForm1.LEADAnn1AnnSelect(phObjects: L_PHANDLE; iCount: Integer);
var
nType: integer;
x: integer;
bSelected: Boolean;
begin
bSelected:= False;
ShowMessage ( IntToStr(iCount) + ' objects were selected' ) ;
for x:= 1 to iCount do
begin
nType:= LEADAnn1.AnnGetType (LEADAnn1.AnnGetItemHandle (phObjects, x - 1));
if ( nType = ANNOBJECT_POLYGON ) then
bSelected:= True;
end;
if ( bSelected <> True ) then
ShowMessage ( 'No Polygon Objects were selected' ) ;
end;