The Feature.ChangeElementType method changes the element type of a selection set of point, multipoint or polygon features.
Declaration
public bool Esri.ArcGISForAutoCAD.Feature.ChangeElementType(Document doc, SelectionSet selectionSet, string newElementTypeString, string newElementDescriptionString)
Parameters
| Type | Name | Description | Required |
|---|---|---|---|
Document | doc | The AutoCAD document to act on. | required |
SelectionSet | selectionSet | An AutoCAD selection set of features. | required |
string | newElementTypeString | The default element type of POINT, Block Reference, or AECC_COGO_POINT.and Hatch or Automatic for polygons | required |
string | newElementDescriptionString | The block name if the type is Block Reference, or a description prefix if the type is COGO Point, or the hatch pattern name for polygons if the type is Hatch. | required if Block Reference or AECC_COGO_POINT |
Returns
| Type | Description |
|---|---|
bool | true if the entity type was changed successfully |
Remarks on error conditions
This method may throw an exception or return false or null if a parameter is invalid.
Example
Print the success of changing the element settings of the selected set with an AutoCAD block insert named Damaged_Structure.// Initialize
var doc = Application.DocumentManager.MdiActiveDocument;
var selectionSet = doc.Editor.GetSelection().Value;
// Change to the designated block
var success = Esri.ArcGISForAutoCAD.Feature.ChangeElementType(doc, selectionSet, "Block Reference", "Damaged_Structure");
// Print the success
doc.Editor.WriteMessage(success.ToString());
/* Example output
True
*/
See also
esri_feature_changeElementType—An AutoLISP function that changes the element type of a selection set of features.