Base each new object class on an existing object. Start by opening a map that contains objects that are typical of the object class you are defining (“model objects”). In this example, you open a map of roads to define the Roads object class.
When you define an object class, you can choose any existing properties of the model object to include as part of the object class definition. You can also add properties. For each property you include, you can specify a default value and an allowable range.
To define an object class
Define an object class by selecting a model object.
Specify the object creation method that existing objects must use to belong to this object class.
All existing objects you add to this class must use the object type you check here. Unless you know for certain that all existing road objects were created using the AcDbLine or AcDbCurve method, it is safer to check only AcDbEntity .
Objects you include in this class always retain their own properties. The properties you specify here are the properties of the class as a whole. Choose properties to set their default values or allowable ranges, or to make them editable for all members of the class.
For example, to be able to change the layer, linetype, or color for all members of the Roads class as a group, select those properties. You can set default values, where appropriate. For example, you can assign all members of the Roads class to a Roads layer.
You can include the following property types:
Specify the properties for objects in this object class, and any default values for those properties.
The following table shows a suggested set of General properties and values for the Roads class.
Property | Value |
---|---|
General Properties | |
Color | Red |
Layer | Schema_Roads |
Linetype | No value |
Lineweight | 0.13 |
For object data fields, clear the values that are specific to the model object you chose. For example, include the NAME and ST_NAME properties to ensure that all new roads you create contain those properties. Delete the values that appear there, because each new road name will differ from the name of the model object.
For example, click the ST_NAME property and look at its values. The default value for the street name is the name of the model object. This value is incorrect for almost any new road you create. Select that value and delete it.
Objects assigned to this class have a ST_NAME property, but the value will be the name for that road (as stored in its object properties). If no value exists, the property is blank. The following table shows a suggested set of OD:Schema_Roads properties and values for the Roads class.
Property | Value |
---|---|
Autogenerated_SDF_ID | No value |
LENGTH | No value |
NAME | No value |
PREFIX | No value |
SEG_ID | No value |
ST_NAME | No value |
ST_TYPE | No value |
SUFFIX | No value |
TYPE | No Value |
Define any custom properties for the object class.
NumberLanes is checked and selected.
Choose the Create Method for new objects you create within this object class.
When you use this class to create a road, use a Polyline to create it. Existing objects you add to this class do not have to be polylines.
To continue this tutorial, go to Exercise 3: Add object classes to the definition file.