You want to describe your features and access the shapeType property. This sample will give you a place to start. import arcpy arcpy.env.workspace = #your workspace fcList = arcpy.ListFeatureClasses() drop_features = list() for feature in fcList: desc = arcpy.Describe(feature) if desc.shapeType == 'Polygon': drop_features.append(feature) for feat in drop_features: arcpy.Delete_management(feat) You can also do away with the drop_features list if you want and just put the deletion where you would add the feature to the drop feature list.
import arcpy arcpy.env.workspace = #your workspace fcList = arcpy.ListFeatureClasses() drop_features = list() for feature in fcList: desc = arcpy.Describe(feature) if desc.shapeType == 'Polygon': drop_features.append(feature) for feat in drop_features: arcpy.Delete_management(feat)
if desc.shapeType != 'Polygon':
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.