AnnLock example for Visual J++
Note: This topic is for Document/Medical only.
This example locks objects of type ANNOBJECT_ELLIPSE using the key "IkeStarnes".
// lock only the ellipse objects that are selected
boolean bSelected = false;
short sCount = LEAD1.AnnGetSelectCount(); // get number of selected objects
Variant aObjects = LEAD1.AnnGetSelectList(); // get the handles of the selected objects
for( int a = 0 ; a < sCount ; a++ )
{
int hObject = aObjects.toSafeArray().getInt( a );
short sType = LEAD1.AnnGetType( hObject );
if( sType == LTOCXU.AnnObjectConstants.ANNOBJECT_ELLIPSE ) // Is the object an ellipse?
{
bSelected = true;
LEAD1.AnnLock( hObject, "IkeStarnes", false );
}
}
if( !bSelected )
MessageBox.show( "No Ellipse Objects were selected" );