Exercise 4: Add a property

AutoCAD Map 3D 2009

 
Exercise 4: Add a property
 
 
 

A set of feature classes and their properties is called a schema. The schema can specify constraints that determine which objects you can add to a particular feature class. For example, to add an object to the Roads feature class, that object might need to be a line. Properties are like attributes—they are characteristics of all objects in the feature class. For example, a Roads feature class property might specify the number of lanes it has, or its speed limit.

You cannot change the schemas for all data source types, but you can edit the schemas for SDF files. In this lesson, edit an SDF schema to add a property to the Roads feature class.

In this exercise you will add new properties that are constrained, so that only certain values are valid for them.

NoteThis exercise uses the map you created and modified in the previous exercises.

Adding a property that is constrained to a range of values

You can specify that only values within a particular range are valid. You can include or exclude each extreme of the range: the lowest possible value and the highest. For example, you can make a range 1 to 100 inclusive, or any value between 1 and 100, but not 1 or 100, or any combination.

To add a property to the Roads feature class that is constrained by range

  1. Switch the Task Pane to Map Explorer.
  2. Select the SDF data source at the top of the pane.
  3. Click Schema Edit Schema.

    Edit the SDF schema.

  4. In the Schema Editor, expand the schema tree on the left to see the three feature classes.
  5. Select the Roads feature class.
  6. Click New Property at the top of the window.

    Property1 appears on the left, under the existing properties.

  7. Specify the characteristics of the new property using the information shown below:

    Create a new property with these values. The last four fields appear after setting the Constraint Type.

    This creates a property that represents the number of lanes for a road. The value must be a whole number between 1 and 5. There is no default value for this property.

    By setting Min Value Included and Max Value Included to true, the highest and lowest values in the range are acceptable entries.

  8. Click Apply.

    The "Property1" entry on the left is updated to show the new name.

  9. Click OK to close the Schema Editor.

To continue this tutorial, go to Exercise 5: Populating the new property with values.