I am trying to run my program and when i get to this part of the program
I get the error that global name 'Primary_OH is not defined. Can someone look at my code and tell what i need to do to fix this.
Thanks
Solved! Go to Solution.
Hi Rick,
The gdb file (File Geodatabase) is the most popular container of data in ArcGIS. However, mxd files can contain multiples types of files and containers (Data sources).
In order to get the Primary_OH_Path of yout layer follow these steps:
Joe,
I guess i will have to change the lines to some other command. What i am trying to do here is go to the properties of a layer and create a definition query (i.e. - [FEEDERID] = "2050") and turn off all of the feeders for that layer (Primary OH) that are not numbered 2050. Am i doing this wrong? Is there another way to do this?
Thanks
Javier,
When i do that i get the following:
There is no .gdb database.
Rick:
You should copy the data to a file gdb from the personal geodatabase that you are currently using as ESRI is migrating to Pro which does not support personal geodatabases that you are using. File geodatabases can be used in both ArcMap (32-bit) and Pro (64-bit).
OK. It does not matter. The container of data is a Personal Geodatabase, is so similar to File Geodatabase
# Primary OH Path
geodatabase = "C:\gismaps\LusData.mdb"
dataset = "ElectricData"
feature_class = "PriOHElectricLineSegment"
Primary_OH_path = r"{0}\{1}\{2}".format(geodatabase, dataset, feature_class)
Primary_OH = arcpy.MakeFeatureLayer_management(Primary_OH_path, "Primary_OH")
thanks everyone for you help. i will see what i need to do to copy the data to a .gdb file.
Will get back with you when this is completed.
You can try testing your script using personal geodatabase for now.
But, as Michael recommends, you should evaluate to migrate your data to File Geodatabase to better support.
Javier,
i entered the code that you suggested:
When running it i get the following errors:
Rick
Try to set another name to the layer object, like "Primary_OH_Layer1", or something like that.
Primary_OH = arcpy.MakeFeatureLayer_management(Primary_OH_path, "Primary_OH_layer1")
i did put this code at the beginning
geodatabase = "C:\gismaps\LusData.mdb"
dataset = "ElectricData"
feature_class = "PriOHElectricLineSegment"