AnnBoundingRect... example for Visual Basic
hObj = LEAD1.AnnCreateItem (LEAD1.AnnContainer, ANNOBJECT_PROTRACTOR, True)
hObj2 = LEAD1.AnnCreateItem(LEAD1.AnnContainer, ANNOBJECT_POLYGON, True)
ReDim x(3) As Single, y(3) As Single
' Assign values for x and y from 1 through 3
x(1) = 10: y(1) = 20
x(2) = 100: y(2) = 200
x(3) = 200: y(3) = 100
LEAD1.AnnSetPoints hObj, x, y, 3
x(0) = 50: y(0) = 220 ' SetPoints starts at 0 because No. of points set to 4
LEAD1.AnnSetPoints hObj2, x, y, 4
LEAD1.AnnSetFillMode hObj2, ANNFILLMODE_OPAQUE, False
Form1.Caption = "Protractor Bounding Rectangle, Left:" & LEAD1.AnnBoundingRectLeft (hObj) & ", Top:" & LEAD1.AnnBoundingRectTop (hObj) & ", Width:" & LEAD1.AnnBoundingRectWidth (hObj) & ", Height:" & LEAD1.AnnBoundingRectHeight(hObj)
LEAD1.AnnBringToFront hObj2
MsgBox "Brought Polygon to front"
Form1.Caption = "Polygon Area:" & LEAD1.AnnGetArea (hObj2)
LEAD1.AnnSendToBack hObj2
MsgBox "Sent Polygon to back"
LEAD1.AnnCut hObj2, ANNFMT_WMF, False, True
Form1.Caption = "Angle:" & LEAD1.AnnGetAngle (hObj)