sdelayer command in Python

401
3
12-14-2010 03:47 AM
AlexProtyagov
New Contributor
Currently we have a batch file that creates feature classes.

Is it possible to do the following :

sdelayer -o register -l M_SIGN_INVENTORY,GEOM -C OBJECTID -u %USERID% -p %USERPASSWORD% -e 3npM -x 0,0,3048 -z 0,10000 -P HIGH -t SDO_GEOMETRY -G file=%CRSFILE%


in python script ?

Initially I create a database table using sql create statement. Table is empty. It has indexes, including index on ObjecID and Spacial index.
Tags (2)
0 Kudos
3 Replies
AndrewChapkowski
Esri Regular Contributor
You can try something like this:
program = "C:\\Python25\\Test\\LH-Sitekit\\sitekit\\engine\\install-nt.bat"
# supply the proper input values as strings
input1 = 'x'
input2 = 'x'
input3 = 'z'

import subprocess
subprocess.call([program, input1, input2, input3])


or you can just use the geoprocessing tools to create tables and featureclasses:
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Create_Feature_Class/00170000002p00000...
0 Kudos
RussellBrennan
Esri Contributor
Attached is a toolbox containing two custom script tools that I wrote a little while ago. The first one will register a spatial table with SDE and then with the geodatabase. The second will register a regular table with SDE and then with the geodatabase. I have hardcoded a number of options either through the script itself or through the tool dialog. You should be able to edit this tool/script to your liking.

Hope this helps,
0 Kudos
AlexProtyagov
New Contributor
1. Thank you for py scrips, I am going to study them. Idea there is to invoke sdelayer.

2. The CreateFeatureclass_management() is something I tried. However, I was unable to figure out how to make resulting table to look like I want. It always creates Oracle table with 3 default columns. I tried to use template but it appears the template gets ignored or perhaps I do not use it correctly.
0 Kudos