For the ArcMap 10.5, "load Objects" tool arcpy codes

308
1
09-22-2024 11:52 PM
baohuachu2
Emerging Contributor

I'm newbie in ArcPy. Is there any APIS the same as "load Objects"(in ArcMap customize mode can find it)?

I want to load features participated in geometric network.

0 Kudos
1 Reply
BruceBacia
Frequent Contributor

I have automated scripts that load features into a geometric network.  I use the Append (Data Management)—ArcMap | Documentation (arcgis.com) tool to load features.  You would likely need to open an edit session on the target database for this, as well.  Example below.

One thing to note - I found that the append method works well if loading less than 10,000 features.  Once you get over this, it would really slow down.  So, if you have a lot of features, you may want to break them up into subsets of 10,000 features and perform an append of each subset into the network.

 

with arcpy.da.Editor(target_db_conx_file) as edit:
            script.logger.info('Appending new meters to target feature class: ' + target_meters_fc)
            arcpy.management.Append(inputs=new_meters_fc, target=target_meters_fc, schema_type='NO_TEST')
            script.logger.info('Successfully appended new meters to target feature class: ' + target_meters_fc)

 

 

0 Kudos