Is there a way to change the domains on a feature class that has sybtypes with arcpy?
My solution:
ListSubtypes—Data Access module | ArcGIS Desktop
Assign Domain To Field—Data Management toolbox | ArcGIS Desktop
import arcpy sde_path = r"xyz" arcpy.env.workspace = sde_path domain = "T_LineSegment" domain_feature_classes = {"feature_class": "domain_field", ....} for feature, domain_field in domain_feature_classes.items(): print "updating domains by subtype on " + feature subtypes = arcpy.da.ListSubtypes(feature) for k, v in subtypes.items(): print "\tsetting domain for subtype code: " + str(k) arcpy.AssignDomainToField_management(feature, domain_field, domain, k)
Check out:
An overview of the Domains toolset
An overview of the Subtypes toolset
You should be able to use these tools to do what you need.
This should be marked as the solution.
No we are still on desktop. But I did judge your last post to fast. It is part of the solution I think for sure. I was just being foolish. I am testing now...
If you are using Pro, there's this:
Create, modify, and delete subtypes
With Desktop, I believe it is a Delete and Add instead of Modify.
I don't see anything in them that will let me set the domain on a field by subtype... unless I am missing something...
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.