Set An Attribute Definition

Land Desktop Map 3D Samples

 
Set An Attribute Definition
 
 
 

This method takes the following arguments:

  • the ObjectData.Table table name
  • the name of one of the ObjectData.FeatureDefinition objects contained in the ObjectData.Table table
  • an Autodesk.AutoCAD.Geometry.Point3d object
    NoteThis is the position argument. It is not used in favor of the alignment argument. Read the description of the AcDbText::SetPosition function in the <Map 3D SDK root folder>\docs\arxdoc.chm file for some discussion of the reason.
  • the total height of the annotation
  • the color of the annotation
  • the annotation text vertical alignment
  • the annotation text horizontal alignment
  • an expression string whose pattern is <feature definition name> = <feature definition name>@<table name>
  • an Autodesk.AutoCAD.Geometry.Point3d object which defines the positioning of the annotation text associated with this FeatureDefinition object. This is the alignment argument.

It does the following:

  1. Gets a reference to the Project.ProjectModel object which represents the active project.
  2. Gets a reference to the active project’s Annotation.Annotations object.
  3. Uses the active project to create a DatabaseServices.Transaction object. All of the following actions take place within the context of this transaction and have no effect in the Database until the transaction commits.
  4. Creates a DatabaseServices.ObjectId object that identifies the Annotation.AnnotationTemplate object for the ObjectData.Table table.
  5. Uses the ObjectId object to create a DatabaseServices.AttributeDefinition object and sets properties on this object using the arguments passed into this method.
  6. Creates a layer name for the annotations and then creates a layer for the annotations, if this has not already been done. This is described in topic Create A Layer Using Autodesk.AutoCAD.DatabaseServices.
  7. Associates the expression, the layer name, and the AttributeDefinition object with the Annotations object.