GenAnnotation

Land Desktop Map 3D Samples

 
GenAnnotation
 
 
 

This command creates a GenerateAnnotationImp object and calls its CreateAnnotation method passing in a feature source identifier string that identifies the signals.sdf file loaded into the resource repository during the netload operation. the name of the schema contained in the signals,.sdf file and the name of the class definition contained in the schema.

  1. Takes three arguments: a feature source identifier string, a schema name and a class name.
  2. Uses the feature source identifier string argument to create an MgResourceIdentifier object.
  3. Uses an MgFeatureService object, the MgResourceIdentifier object and the schema and class names to get the MgClassDefinition object for the named class.
  4. Makes a table name by concatenating the schema and class names.
  5. Uses the table name and the MgClassDefinition object to make an Object Data table and put it in the active project’s Object Data tables property. This is described in topic Create An Object Data Table.
    NoteAn Object Data table is a planar entity that can be created and placed in an arbitrary plane in 3D space. A table is generally thought of as an n x m rectangular array of cells whose contents consist of annotation objects, primarily text.
  6. Get the features from the signals.sdf file. Extract the geometry from the feature and from the geometry get the centroid coordinates. Use the centroid coordinate to create a DatabaseServices.Entity object and add the latter to the DatabaseServices.BlockTableRecord object which is used for the Model Space. Generate a DatabaseServices.ObjectId object to identify the DatabaseServices.Entity object. Use the feature’s data properties to create Utilities.MapValue objects, add the MapValue objects to an ObjectData.Record object, and add the Record object along with the ObjectId object to the Object Data table created in the preceding step. This is described in more detail in the topic Create Centroids.
  7. Uses the current project’s Autodesk.Gis.Map.Annotation.Annotations object to create an Annotation.AnnotationTemplate object for the Object Data table. The annotation template is stored in a BlockTableRecord object in the database. This is described in topic Create An Annotation Template.
  8. Attach the annotations to the centroids in the drawing pane. This is described in the topic Insert The Annotations.