The esri_featurelayer_setDefaultElementType function sets the default element type of a feature layer and, if successful, returns those settings.
Syntax
(esri_featurelayer_setDefaultElementType flname subtype element_settings)
Arguments
- flname | string | required | An existing feature layer name in the drawing.
- subtype | string | required | An existing feature layer subtype name in the drawing. Use "" for an empty string if no subtype is provided.
- element_settings | associated list | required | An associated list of settings as dotted pairs defined as follows:
| Associated label | Value type | Value description | Required or optional |
|---|---|---|---|
| TYPE | String | The type value is the AutoCAD or Civil 3D entity type used when new features are created in ArcGIS for AutoCAD. The valid values are POINT, Block Reference, and AECC_COGO_POINT. For polygon hatches, the type values are Hatch and Automatic. Automatic omits any hatch fill symbol for polygons. | Required |
| DESCRIPTION | String | The block name if the type is Block Reference, or a description if the type is AECC_COGO_POINT, or the hatch pattern name for polygons. | Required |
Example usage
This example sets the default element settings of a feature layer named Damage_to_Residential_Buildings with no subtype to be an AutoCAD block reference named Damaged_Structure. (esri_featurelayer_setDefaultElementType
"Damage_to_Residential_Buildings"
""
(list (cons "TYPE" "Block Reference") (cons "DESCRIPTION" "Damaged_Structure"))
)
Result example usage
This example sets the default element type of the feature layer and returns the element_settings argument as an associated list:
(("TYPE"."Block Reference")("DESCRIPTION"."Damaged_Structure"))Return values
The following are the possible return values:
- If successful, an associated list is returned in which the TYPE value is the POINT, Block Reference, or COGO Point entity type for points and multipoints, or Hatch or Automatic for polygons, and the DESCRIPTION value is the block reference name, COGO point description prefix, or hatch pattern name.
- If failed, a list is returned with the first value of nil; then an associated list is returned containing the key value Error and an associated error message as a string: (nil ( "Error" . "<message>")).
Failed return values
A failed return value can occur for any of the following reasons:
- (nil ("Error" . "Missing required
argument."))
One of the three required arguments was not provided.
- (nil ("Error" . "Unsupported geometry type."))
The function works with point, multipoint, and polygon layers.
- (nil ("Error" . "No feature layer specified."))
No valid feature layer was provided.
- (nil ("Error" . "Feature layer not found."))
The specified feature layer does not exist in the file.
- (nil ("Error" . "Subtype name does not exist."))
The specified subtype does not exist.
- (nil ("Error" . "Incorrect argument."))
The specified TYPE value may be an invalid type.