Good morning!
I want to execute a Python script that rebuilds the spatial index of a feature class. I have followed the steps described here: https://knowledge.safe.com/articles/1190/using-a-python-startupshutdown-script-to-perform-g.html
The script I use is the following:
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# test.py
# Created on:
# (generated by ArcGIS/ModelBuilder)
# Description:
# ---------------------------------------------------------------------------
# Set the necessary product code
import arceditor
# Import arcpy module
import arcpy
# Local variables:
TEST_sde = "C:\\Users\\TestUser\\AppData\\Roaming\\ESRI\\Desktop10.2\\ArcCatalog\\TEST.sde"
# Process: Rebuild Indexes
arcpy.RebuildIndexes_management(TEST_sde, "NO_SYSTEM", "TEST.DBO.FC_TEST", "ALL")
But everytime I run the the FME project I get this error:
Python Exception <ExecuteError>: Failed to execute. Parameters are not valid.
ERROR 000837: The workspace is not the correct workspace type.
If I run this in ArcMap with the same parameters, there is no error. So I don't understand why FME says the parameters are not valid.
Does anyone know something about this?
- FME Desktop 2016
- ArcGIS Desktop 10.2.2
- TEST.sde is a geodatabase in SQL Server 2008 R2
Thanks for any help provided!