Simplify bad Geometry

Importing data from external sources such as AutoCAD, Microstation may introduce geometry that ArcGIS does not support, such polylines or polygons with irregular vertices. The simplify command simplifies the geometries of the selected  features to ensure that the geometry is valid.

IGeometry5 cadGeometry = cadFeature.ShapeCopy as IGeometry5;
 ITopologicalOperator3 topoOp = cadGeometry as ITopologicalOperator3;
if (topoOp != null)
{
topoOp.IsKnownSimple_2 = false;
switch (cadGeometry.GeometryType)
{
case esriGeometryType.esriGeometryMultipoint:
topoOp.Simplify();
break;
case esriGeometryType.esriGeometryPolygon:
((IPolygon)cadGeometry).SimplifyPreserveFromTo();
break;
case esriGeometryType.esriGeometryPolyline:
if (cadGeometry is IPolyline5)
((IPolyline5)cadGeometry).SimplifyNetwork();
else
topoOp.Simplify();
break;
default:
break;
}
}