Select to view content in your preferred language

Registering/Unregistering data using ArcPython

753
0
08-24-2014 01:51 AM
MoizIshfaq
Emerging Contributor

Greetings,
I developed a ArcPython based code snippet for automating the registering/unregistering data as versione and it used to work fine till 10.1 but with my upgrade to 10.2.2 it stopped working, resulting in crashing ArcCatalog. Here is the code snippet.

for obj in datasets2Process4VersioningOperation:

        showMessage("Un-registering Dataset - "+ obj)

        if arcpy.Exists(obj):

            if isDataVersioned(obj):

                showMessage(obj + " needs to be unregistered as versioned")

                arcpy.UnregisterAsVersioned_management(obj, "NO_KEEP_EDIT", "NO_COMPRESS_DEFAULT")

            else:

                showWarning(obj + " is already not versioned")

        else:

            showWarning(obj + " does not exist in the target environment")

def isDataVersioned(obj):

    if arcpy.Describe(obj).IsVersioned:

        return True

    else:

        return False

def showMessage(msg):

    arcpy.AddMessage(msg);

If I am using the ArcCatalog functionality to Register or unregister than it works fine. Can someone verify if I am alone receiving this error message or it is a common problem with 10.2.2. I am working in Windows 7 environment.

Regards.

0 Kudos
0 Replies