0

I am looking for a way to create an Historical Marker programmatically with arcpy.

The archiving is enabled on a dataset in Oracle SDE.

I think, it's related with arcpy Version Toolset, but I can't find the documentation about this.

#this is an non-working attemp because CreateHistoricalMarker_management() method does not exists
import arcpy, datetime

my_dataset = "c:\\gis\\connection_file.sde\\an_archived_dataset\\a_feature_class"
marker_name = "A new dummy marker"
marker_datetime = datetime.datetime.utcnow()

arcpy.CreateHistoricalMarker_management(my_dataset, marker_name, marker_datetime)

>>>AttributeError: 'module' object has no attribute 'CreateHistoricalMarker_management'
3
  • 1
    You're trying to call a tool/function that doesn't exist. I'm not an expert in this area, but a quick google search doesn't turn up anything I can see for arcpy and historical marker. My first guess is this stuff isn't available in arcpy. But since I dont have knowledge in this area, I'm not making this claim with certainty.
    – KHibma
    Commented Mar 9, 2017 at 19:43
  • I know this method does not exist, but I know it's with the CreateVersion_management() arcpy method that it will work Commented Mar 9, 2017 at 20:17
  • sorry, I didnt fully read your comments in the code
    – KHibma
    Commented Mar 9, 2017 at 20:19

1 Answer 1

0

An answer took from Geonet Esri forum:

To create a Historical Marker from Python, an option is using comTypes. Following the next steps, you can create Historical Markers in a Enterprise Geodatabase from Python:

Environment: ArcGIS for Desktop 10.4.1 + Python 2.7

  1. Install comtypes-0.6.2.win32.exe (attached)
  2. Go to comtypes folder in "C:\Python27\ArcGIS10.4\Lib\site-packages\comtypes", and delete the automation.pyc, automation.pyo, safearray.pyc, safearray.pyo files. Edit the file automation.py and insert POINTER(BSTR): VT_BYREF|VT_BSTR, in the _ctype_to _vartype dictionary.

  3. Delete all files in C:\Python27\ArcGIS10.4\Lib\site-packages\comtypes\gen

  4. Copy the file Snippets.py (attached), into C:\Python27\ArcGIS10.4\Lib

  5. From Python Script you must to implement a function to create the Historical Marker. (the example in the test.py file that can be found in Geonet Esri forum)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.