AutoCAD.Net/C#.Net QQ群:193522571 各图元对应的DXF名
public static bool IsInFilter(this Entity ent, string str) { string typ = ent.GetType().Name; List<string> nameLst = str.ToList(); string lspType = ""; switch (typ) { case "Arc": lspType = "ARC"; break; case "AttributeDefinition": lspType = "ATTDEF"; break; case "AttributeReference": lspType = "ATTRIB"; break; case "Circle": lspType = "CIRCLE"; break; case "Ellipse": lspType = "ELLIPSE"; break; case "Hatch": lspType = "HATCH"; break; case "BlockReference": lspType = "INSERT"; break; case "Leader": lspType = "LEADER"; break; case "Line": lspType = "LINE"; break; case "Polyline": lspType = "LWPOLYLINE"; break; case "Mline": lspType = "MLINE"; break; case "MLeader": lspType = "MULTILEADER"; break; case "MText": lspType = "MTEXT"; break; case "Ray": lspType = "RAY"; break; case "Region": lspType = "REGION"; break; case "Solid": lspType = "SOLID"; break; case "Spline": lspType = "SPLINE"; break; case "Table": lspType = "TABLE"; break; case "DBText": lspType = "TEXT"; break; case "Viewport": lspType = "VIEWPORT"; break; case "Wipeout": lspType = "WIPEOUT"; break; case "Xline": lspType = "XLINE"; break; default: break; } if (str.ToUpper().Contains("DIMENSION")) { lspType = "DIMENSION"; } return str.ToUpper().ToList().Contains(lspType); }