I am writing a Python toolbox. I have an input parameter which should accept a Simple Edge (part of Geometric Network) or a polyline feature class (no edge).
How can I use the Filter list so it can see both Simple Edge and Polyline feature class types? It looks like the filter doesn't work with simple edge.
param2 = arcpy.Parameter(
displayName="Gravity Main Links",
name="fcLink",
datatype="DEFeatureClass",
parameterType="Required",
direction="Input")
# if I comment out this line it sees the simple edge
# but it shows all types of feature classes. I just need to see polylines
param2.filter.list = ["Polyline"]
You have simple edge in featureclasses as a featuretype
FeatureClass properties—ArcGIS Pro | Documentation
Thank you for the response but how can it be used as Filter Type? I don't see any option for simple edge in filter type.
Test for its type
import arcpy
fc = r"C:\arcpro_npg\npg\Project_npg\npgeom.gdb\Polylines"
desc = arcpy.da.Describe(fc)
fc_type = desc['featureType']
if fc_type == 'Simple':
print("do stuff")
else:
print("not the right type")
do stuff
if fc_type == 'SimpleEdge':
print("do stuff")
else:
print("not the right type")
not the right type