←Select platform

FindObject Method

Summary

Finds the AnnAutomationObject associated with a certain id.

Syntax

C#
VB
C++
public AnnAutomationObject FindObject( 
   int id 
) 
  
Public Function FindObject( _ 
   ByVal id As Integer _ 
) As Leadtools.Annotations.AnnAutomationObject 
public: 
Leadtools.Annotations.AnnAutomationObject^ FindObject(  
   int id 
)  

Parameters

id
The id of the AnnAutomationObject to find

Return Value

The AnnAutomationObject from Objects for this id if found; null (Nothing in VB) otherwise.

Remarks

This method enumerates all of the AnnAutomationObject items in the Objects collection and compares AnnAutomationObject.Id with id.

Example

This example changes the line color of new line automation objects to blue.

C#
VB
using Leadtools; 
using Leadtools.Annotations; 
using Leadtools.WinForms; 
using Leadtools.Codecs; 
 
public void AnnAutomationManager_FindObject(AnnAutomationManager manager) 
{ 
   // fine the line automation object 
   AnnAutomationObject obj = manager.FindObject(AnnAutomationManager.LineObjectId); 
   if (obj != null) 
      obj.Object.Pen = new AnnPen(Color.Blue, new AnnLength(1, AnnUnit.Pixel)); 
} 
Imports Leadtools 
Imports Leadtools.Annotations 
Imports Leadtools.WinForms 
Imports Leadtools.Codecs 
 
Public Sub AnnAutomationManager_FindObject(ByVal manager As AnnAutomationManager) 
   ' fine the line automation object 
   Dim obj As AnnAutomationObject = manager.FindObject(AnnAutomationManager.LineObjectId) 
   If Not obj Is Nothing Then 
      obj.Object.Pen = New AnnPen(Color.Blue, New AnnLength(1, AnnUnit.Pixel)) 
   End If 
End Sub 

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Annotations Assembly