Hello.
I'm trying to make a python script to add a rule to a topology. I run it and this error occurs:
Traceback (most recent call last):
File "C:\Mis documentos\arcgis\scripts\creatopologia.py", line 30, in ?
gp.AddRuleToTopology_management(capaTopologia, "Must Not Intersect (Line)", featureDataSet + "TRAMO", "", "", "")
RuntimeError:
The topology rule is invalid/malformed.
Failed to execute (AddRuleToTopology).
-capaTopologia is a variable, it contains "C:\Mis documentos\baleares.mdb\Datos\Topologia_tramos_y_cruces"
-featureDataSet is a variable too, it contains "C:\Mis documentos\baleares.mdb\Datos\"
- and TRAMO is a Feature Class in the feature dataset "C:\Mis documentos\baleares.mdb\Datos\"
¿Where is the problem? I think that the expression is well-formed, it's like the examples of arcgis.
addruletopology scripting syntax
Started by
ktulu
, Nov 26 2007 08:21 AM
5 replies to this topic
#1
Posted 26 November 2007 - 08:21 AM
#2
Posted 26 November 2007 - 10:08 AM
Looks like you need to either escape the whacks or use forward slashes in your variables:
C:\Mis documentos\baleares.mdb\Datos\Topologia_tramos_y_cruces
should be:
var = 'C:/Mis documentos/baleares.mdb/Datos/Topologia_tramos_y_cruces'
or
var = 'C:\\Mis documentos\\baleares.mdb\\Datos\\Topologia_tramos_y_cruces'
You may also want to post your issue (including your code) to the ESRI Python forum at:
http://forums.esri.c...=93&s=1729#1729
HTH
chad
C:\Mis documentos\baleares.mdb\Datos\Topologia_tramos_y_cruces
should be:
var = 'C:/Mis documentos/baleares.mdb/Datos/Topologia_tramos_y_cruces'
or
var = 'C:\\Mis documentos\\baleares.mdb\\Datos\\Topologia_tramos_y_cruces'
You may also want to post your issue (including your code) to the ESRI Python forum at:
http://forums.esri.c...=93&s=1729#1729
HTH
chad
#3
Posted 26 November 2007 - 02:36 PM
see what happens when you try to run the exact same command using the toolbox, I bet you get the same error...
#4
Posted 26 November 2007 - 03:43 PM
Put a lower case r in front of your strings when you define the variables. This tells Python to process them as "raw". For example:
capaTopologia = r"C:\Mis documentos\baleares.mdb\Datos\Topologia_tramos_y_cruces"
capaTopologia = r"C:\Mis documentos\baleares.mdb\Datos\Topologia_tramos_y_cruces"
Charlie Frye
Chief Cartographer
Software Products Department
ESRI, Redlands, California
Chief Cartographer
Software Products Department
ESRI, Redlands, California
#5
Posted 26 November 2007 - 03:46 PM
Also,
You also need to set the in_featureclass2 variable because the rule you're adding requires two feature classes. If you really mean "Must Not Self-Intersect (Line)" then change the rule parameter.
Another tip is to try doing the task using the user interface as that will tell you which parameters will need to be used.
You also need to set the in_featureclass2 variable because the rule you're adding requires two feature classes. If you really mean "Must Not Self-Intersect (Line)" then change the rule parameter.
Another tip is to try doing the task using the user interface as that will tell you which parameters will need to be used.
Charlie Frye
Chief Cartographer
Software Products Department
ESRI, Redlands, California
Chief Cartographer
Software Products Department
ESRI, Redlands, California
#6
Posted 27 November 2007 - 02:54 AM
There is no problem with the paths, I wrote '\\' in the scripts. The problem is, it's necessary to execute the AddFeatureClassToTopology command with the feature class TRAMO before executing the AddRule Topology.
Thank you for your comments.
Thank you for your comments.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users


Sign In
Create Account
Spain
Back to top
United States
Sweden









