←Select platform

CreateDefaultObjects Method

Summary
Creates the default automation annotation objects.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public void CreateDefaultObjects() 
- (void)createDefaultObjects; 
public void createDefaultObjects() 
public:  
   void CreateDefaultObjects() 
def CreateDefaultObjects(self): 
Remarks

Call this method to create the default automation annotation objects.

The following table lists the ID name and corresponding description for each of the default automation objects:

Id Object
GroupObjectId Special automation object that manages groups and the selection of multiple objects.
SelectObjectId Special automation object that manages the case where no object is selected.
CrossProductObjectId Automation object for AnnCrossProductObject
CurveObjectId Automation object for AnnCurveObject
EllipseObjectId Automation object for AnnEllipseObject
FreehandHotspotObjectId Automation object for AnnFreehandHotspotObject
HiliteObjectId Automation object for AnnHiliteObject
HotspotObjectId Automation object for AnnHotspotObject
NoteObjectId Automation object for AnnNoteObject
PointerObjectId Automation object for AnnPolylineObject
PointObjectId Automation object for AnnPointObject
PolylineObjectId Automation object for AnnPolylineObject
PolyRulerObjectId Automation object for AnnPolyRulerObject
ProtractorObjectId Automation object for AnnProtractorObject
RectangleObjectId Automation object for AnnRectangleObject
RedactionObjectId Automation object for AnnRedactionObject
RubberStampObjectId Automation object for AnnRubberStampObject
StampObjectId Automation object for AnnStampObject
TextObjectId Automation object for AnnTextObject
TextPointerObjectId Automation object for AnnTextPointerObject
TextRollupObjectId Automation object for AnnTextRollupObject
Example
C#
using Leadtools.Annotations.Automation; 
using Leadtools.Annotations.Engine; 
using Leadtools.Codecs; 
using Leadtools.Controls; 
using Leadtools.Annotations.WinForms; 
using Leadtools.Annotations.Rendering; 
using Leadtools.Annotations.Designers; 
 
public void AnnAutomationManager_FindObjectById() 
{ 
   // find the line automation object 
   AnnAutomationObject obj = _automation.Manager.FindObjectById(AnnObject.LineObjectId); 
   if (obj != null) 
   { 
      obj.ObjectTemplate.Stroke = AnnStroke.Create(AnnSolidColorBrush.Create("Blue"), LeadLengthD.Create(2)); 
   } 
 
   // Check if it is active 
   AnnAutomations annAutomations = _automation.Manager.Automations; 
   foreach(AnnAutomation annAutomation in annAutomations) 
      Console.WriteLine($"Is AnnAutomation Active?: {annAutomation.Active}"); 
 
   // Restarting _automation without objects 
   StartupNoObjects(); 
   // There should be no Automation Objects 
   Console.WriteLine($"Number of Annotation Objects Available: {_automation.Manager.Objects.Count}"); 
   // Create Default Automation Objects 
   _automation.Manager.CreateDefaultObjects(); 
   Console.WriteLine($"Number of Created Annotation Objects: {_automation.Manager.Objects.Count}"); 
   foreach (AnnAutomationObject defaultObject in _automation.Manager.Objects) 
   { 
      defaultObject.RunDesignerType = typeof(AnnRunDesigner); 
      Console.WriteLine($"ID: {defaultObject.Id} | {defaultObject.Name} | Draw Designer Type: {defaultObject.DrawDesignerType.Name} | Edit Designer Type: {defaultObject.EditDesignerType.Name} | Run Designer Type: {defaultObject.RunDesignerType.Name}"); 
   } 
} 
 
public void StartupNoObjects() 
{ 
   _viewer = new AutomationImageViewer(); 
   _viewer.Image = RasterImage.CreateGrayscale(500, 500, 8, 100); 
   _manager = new AnnAutomationManager(); 
   _automation = new AnnAutomation(_manager, _viewer); 
   _automation.Active = true; 
   _automation.Container.Size = new LeadSizeD(500, 500); 
   _automation.AutomationControl.RenderingEngine = new AnnWinFormsRenderingEngine(); 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Annotations.Automation Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.