foreach (dbx.AcadEntity Entity in _AxDbDocument.ModelSpace) { switch (Entity.EntityName) { case "AcDbPoint": dbx.AcadPoint ePoint =( dbx.AcadPoint) Entity; break; case "AcDbMText": dbx.AcadMText eMText = (dbx.AcadMText)Entity; break; case "AcDbText": dbx.AcadText eText = (dbx.AcadText)Entity; break; case "AcDbLine": dbx.AcadLine eLine = (dbx.AcadLine)Entity; break; case "AcDbSpline": dbx.AcadSpline eSpline = (dbx.AcadSpline)Entity; break; case "AcDbPolyline": dbx.AcadLWPolyline eLPolyline = (dbx.AcadLWPolyline)Entity; break; case "AcDb2dPolyline": ????????????????????????????????????????????????? break; case "AcDb3dPolyline": dbx.Acad3DPolyline ePolyline = (dbx.Acad3DPolyline)Entity; break; case "AcDbArc": dbx.AcadArc eArc = (dbx.AcadArc)Entity; break; case "AcDbCircle": dbx.AcadCircle eCircle = (dbx.AcadCircle)Entity; break; case "AcDbEllipse": dbx.AcadEllipse eEllipse = (dbx.AcadEllipse)Entity; break; case "AcDbBlockReference": dbx.AcadBlockReference eBlockReference = (dbx.AcadBlockReference)Entity; break; default: break; } } 上面代码中如果是直线类,这可以转换成dbx.AcadLine eLine = (dbx.AcadLine)Entity;但 AcDb2dPolyline中对应的类不知道该转换成那个类?请大家帮助?? |