|
POST
|
It works fine but the elapsed time is not printed for the “select by attribute” tool # -*- coding: utf-8 -*-
"""
Generated by ArcGIS ModelBuilder on : 2022-09-02 12:37:39
"""
import arcpy, time
def Model(): # IndexingElapsedTime
# To allow overwriting outputs change overwriteOutput option to True.
arcpy.env.overwriteOutput = True
# Model Environment settings
with arcpy.EnvManager(scratchWorkspace=r"C:\Z8\Q.gdb", workspace=r"C:\Z8\Parcels_NonIndexed.gdb"):
Parcels = "Parcels"
# Process: Copy Features (Copy Features) (management)
Output_Feature_Class = "C:\\Z8\\Q.gdb\\Parcels_CopyFeatures"
arcpy.management.CopyFeatures(in_features=Parcels, out_feature_class=Output_Feature_Class, config_keyword="", spatial_grid_1=None, spatial_grid_2=None, spatial_grid_3=None)
# Process: Add Attribute Index (Add Attribute Index) (management)
Parcels_CopyFeatures = arcpy.management.AddIndex(in_table=Output_Feature_Class, fields=["ParcelNumber"], index_name="ParcelNumber", unique="NON_UNIQUE", ascending="NON_ASCENDING")[0]
# Process: Select Layer By Attribute (Select Layer By Attribute) (management)
startTime = time.time()
Parcels_CopyFeatures_Layer, Count = arcpy.management.SelectLayerByAttribute(in_layer_or_view=Parcels_CopyFeatures, selection_type="NEW_SELECTION", where_clause="ParcelNumber = '72'", invert_where_clause="")
endTime = time.time()
elapsedTime = endTime - startTime
arcpy.AddMessage(f"Selection took {elapsedTime} seconds to complete")
# Process: Copy Features (2) (Copy Features) (management)
Output_Feature_Class_2_ = "C:\\Z8\\Q.gdb\\Parcels_CopyFeatures1"
arcpy.management.CopyFeatures(in_features=Parcels, out_feature_class=Output_Feature_Class_2_, config_keyword="", spatial_grid_1=None, spatial_grid_2=None, spatial_grid_3=None)
# Process: Select Layer By Attribute (2) (Select Layer By Attribute) (management)
startTime = time.time()
Parcels_CopyFeatures1_Layer, Count_2_ = arcpy.management.SelectLayerByAttribute(in_layer_or_view=Output_Feature_Class_2_, selection_type="NEW_SELECTION", where_clause="ParcelNumber = '72'", invert_where_clause="")
endTime = time.time()
elapsedTime = endTime - startTime
arcpy.AddMessage(f"Selection took {elapsedTime} seconds to complete")
if __name__ == '__main__':
Model()
... View more
09-02-2022
12:13 PM
|
0
|
1
|
2790
|
|
POST
|
My understanding is that the reconcile is the process of one side data synchronization from parent to child (data that is available in parent are transferred to child) and thus I was assuming the “reconcile” tool needs to be active (as the parent data source is selected) and provides a list of child versions to apply the synchronization with Tin return, the “post” process is the data synchronization from child versions to parent
... View more
09-02-2022
12:03 PM
|
0
|
0
|
697
|
|
POST
|
I got an error as per the screenshot below # -*- coding: utf-8 -*-
"""
Generated by ArcGIS ModelBuilder on : 2022-09-02 12:37:39
"""
import arcpy, time
def Model(): # IndexingElapsedTime
# To allow overwriting outputs change overwriteOutput option to True.
arcpy.env.overwriteOutput = True
# Model Environment settings
with arcpy.EnvManager(scratchWorkspace=r"C:\Z8\Q.gdb", workspace=r"C:\Z8\Parcels_NonIndexed.gdb"):
Parcels = "Parcels"
# Process: Copy Features (Copy Features) (management)
Output_Feature_Class = "C:\\Z8\\Q.gdb\\Parcels_CopyFeatures"
arcpy.management.CopyFeatures(in_features=Parcels, out_feature_class=Output_Feature_Class, config_keyword="", spatial_grid_1=None, spatial_grid_2=None, spatial_grid_3=None)
# Process: Add Attribute Index (Add Attribute Index) (management)
Parcels_CopyFeatures = arcpy.management.AddIndex(in_table=Output_Feature_Class, fields=["ParcelNumber"], index_name="ParcelNumber", unique="NON_UNIQUE", ascending="NON_ASCENDING")[0]
# Process: Select Layer By Attribute (Select Layer By Attribute) (management)
startTime = time.time()
Parcels_CopyFeatures_Layer, Count = arcpy.management.SelectLayerByAttribute(in_layer_or_view=Parcels_CopyFeatures, selection_type="NEW_SELECTION", where_clause="ParcelNumber = '72'", invert_where_clause="")
endTime = time.time()
elapsedTime = endTime - startTime
arcpy.AddMessageE(f"Selection took {elapsedTime} seconds to complete")
# Process: Copy Features (2) (Copy Features) (management)
Output_Feature_Class_2_ = "C:\\Z8\\Q.gdb\\Parcels_CopyFeatures1"
arcpy.management.CopyFeatures(in_features=Parcels, out_feature_class=Output_Feature_Class_2_, config_keyword="", spatial_grid_1=None, spatial_grid_2=None, spatial_grid_3=None)
# Process: Select Layer By Attribute (2) (Select Layer By Attribute) (management)
startTime = time.time()
Parcels_CopyFeatures1_Layer, Count_2_ = arcpy.management.SelectLayerByAttribute(in_layer_or_view=Output_Feature_Class_2_, selection_type="NEW_SELECTION", where_clause="ParcelNumber = '72'", invert_where_clause="")
endTime = time.time()
elapsedTime = endTime - startTime
arcpy.AddMessageE(f"Selection took {elapsedTime} seconds to complete")
if __name__ == '__main__':
Model()
... View more
09-02-2022
09:11 AM
|
0
|
1
|
2807
|
|
POST
|
ArcGIS Enterprise (Pro 3.0.1): Why the “reconcile” tool is not active when the source of parent version is selected? I observed that the “reconcile” tool is not active when the source of parent version is selected. It gets active as the child version is selected. Is this by design?
... View more
09-02-2022
05:20 AM
|
0
|
2
|
829
|
|
POST
|
I exported the model into a python but couldn’t figure out how to stick the piece of code you have already provided in order to get the time printed. Could you please help me on this? # -*- coding: utf-8 -*-
"""
Generated by ArcGIS ModelBuilder on : 2022-09-02 12:37:39
"""
import arcpy
def Model(): # IndexingElapsedTime
# To allow overwriting outputs change overwriteOutput option to True.
arcpy.env.overwriteOutput = False
# Model Environment settings
with arcpy.EnvManager(scratchWorkspace=r"C:\Z8\Q.gdb", workspace=r"C:\Z8\Parcels_NonIndexed.gdb"):
Parcels = "Parcels"
# Process: Copy Features (Copy Features) (management)
Output_Feature_Class = "C:\\Z8\\Q.gdb\\Parcels_CopyFeatures"
arcpy.management.CopyFeatures(in_features=Parcels, out_feature_class=Output_Feature_Class, config_keyword="", spatial_grid_1=None, spatial_grid_2=None, spatial_grid_3=None)
# Process: Add Attribute Index (Add Attribute Index) (management)
Parcels_CopyFeatures = arcpy.management.AddIndex(in_table=Output_Feature_Class, fields=["ParcelNumber"], index_name="ParcelNumber", unique="NON_UNIQUE", ascending="NON_ASCENDING")[0]
# Process: Select Layer By Attribute (Select Layer By Attribute) (management)
Parcels_CopyFeatures_Layer, Count = arcpy.management.SelectLayerByAttribute(in_layer_or_view=Parcels_CopyFeatures, selection_type="NEW_SELECTION", where_clause="ParcelNumber = '72'", invert_where_clause="")
# Process: Copy Features (2) (Copy Features) (management)
Output_Feature_Class_2_ = "C:\\Z8\\Q.gdb\\Parcels_CopyFeatures1"
arcpy.management.CopyFeatures(in_features=Parcels, out_feature_class=Output_Feature_Class_2_, config_keyword="", spatial_grid_1=None, spatial_grid_2=None, spatial_grid_3=None)
# Process: Select Layer By Attribute (2) (Select Layer By Attribute) (management)
Parcels_CopyFeatures1_Layer, Count_2_ = arcpy.management.SelectLayerByAttribute(in_layer_or_view=Output_Feature_Class_2_, selection_type="NEW_SELECTION", where_clause="ParcelNumber = '72'", invert_where_clause="")
if __name__ == '__main__':
Model()
... View more
09-02-2022
03:43 AM
|
0
|
1
|
2823
|
|
POST
|
It appears that the issue here is due to the spatial reference inconsistencies between the map and the layer. Having the layer in the same coordinate system as the map resolves the issue. L3, for example, doesn’t have this issue as it has a projected coordinate system
... View more
09-01-2022
11:04 PM
|
0
|
0
|
731
|
|
POST
|
Great. Thank you for the help I just summarized the “CommunityClassification_English” field and used it to import the domain values to the geodatabase.
... View more
09-01-2022
10:18 PM
|
0
|
0
|
1648
|
|
POST
|
ArcGIS Pro 3.0.1: How to measure the time for performing a particular tool in the model builder? For example, the model below is intended to query an indexed and a nonindexed layer. I wanted to compare the time between these two cases. This is why I need a tool to measure the time to perform the “select by attribute” in these two cases.
... View more
09-01-2022
09:59 PM
|
0
|
13
|
3953
|
|
POST
|
Right. It works like a charm. Thank you guys for the help I fixed the source workspace and allowed overwriting as per the code below. ------------------------- # -*- coding: utf-8 -*- """ Generated by ArcGIS ModelBuilder on : 2022-09-02 06:56:18 """ import arcpy def Model(): # Buffer # To allow overwriting outputs change overwriteOutput option to True. arcpy.env.overwriteOutput = True # Model Environment settings with arcpy.EnvManager(scratchWorkspace=r"C:\Z7\Q.gdb", workspace=r"C:\Z7\P.gdb"): L1 = "L1" # Process: Buffer (Buffer) (analysis) L1_Buffer = "C:\\Z7\\Q.gdb\\L1_Buffer" arcpy.analysis.Buffer(in_features=L1, out_feature_class=L1_Buffer, buffer_distance_or_field="5 Meters", line_side="FULL", line_end_type="ROUND", dissolve_option="NONE", dissolve_field=[], method="PLANAR") if __name__ == '__main__': Model() --------------------------------------------- At the level of windows scheduler, I filled out the fllowing: Program\script: c:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe Add Arguments "c:\Z7\Buffer.py"
... View more
09-01-2022
09:43 PM
|
2
|
0
|
4603
|
|
POST
|
All what I wanted here is to run the buffer tool by windows task scheduler. The python script is extracted from the model. It runs successfully thought the Pro as per the screenshots below. ------------------ # -*- coding: utf-8 -*- """ Generated by ArcGIS ModelBuilder on : 2022-08-31 11:41:53 """ import arcpy def Model(): # Buffer # To allow overwriting outputs change overwriteOutput option to True. arcpy.env.overwriteOutput = True # Model Environment settings with arcpy.EnvManager(scratchWorkspace=r"C:\Z7\Q.gdb"): L1 = "L1" # Process: Buffer (Buffer) (analysis) L1_Buffer = "C:\\Z7\\Q.gdb\\L1_Buffer" arcpy.analysis.Buffer(in_features=L1, out_feature_class=L1_Buffer, buffer_distance_or_field="5 Meters", line_side="FULL", line_end_type="ROUND", dissolve_option="NONE", dissolve_field=[], method="PLANAR") if __name__ == '__main__': # Global Environment settings with arcpy.EnvManager(workspace=r"C:\Users\jamal2\AppData\Local\Temp\ArcGISProTemp13328\3aee01c4-83fc-49dc-a1a9-1160767de7fc\Default.gdb"): Model() ------------------------- Why the script fails to run from the windows task scheduler?
... View more
09-01-2022
11:16 AM
|
0
|
1
|
5203
|
|
POST
|
Great. It works fine. By unchecking\rechecking the versioning option one can disable\enable the “move edits to base” option
... View more
09-01-2022
10:33 AM
|
0
|
0
|
1073
|
|
POST
|
The .bat file appears not to work as per the screenshots below
... View more
09-01-2022
09:57 AM
|
0
|
1
|
5215
|
|
POST
|
ArcGIS Enterprise (Pro 3.0.1): Why the “replace with edit version” option is not available when working with versioning “conflict” Window I couldn’t figure out why the “replace with edit version” option is not available when working with versioning “conflict” Window. This option should show how things will be if the conflict is revolved in the favor of the child version. The screenshots below shows the Pro behavior regarding a feature with conflict
... View more
09-01-2022
08:11 AM
|
0
|
0
|
578
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-16-2026 08:17 AM | |
| 1 | 09-30-2022 10:43 PM | |
| 2 | 05-05-2025 10:33 AM | |
| 1 | 05-08-2025 09:49 PM | |
| 1 | 05-06-2025 11:10 PM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|