POST
|
Currently my HEIGHTAGL_Meters field is populated with values in feet. I'm trying to incorporate the below into a longer string of code but it fails when I add it in. I'm pretty sure it's how I have [HEIGHTAGL_Meters]/ 3.2808399", "VB" written, but I'm not sure. Any help would be appreciated. arcpy.CalculateField_management(PointFeatures, "HEIGHTAGL_Meters", "[HEIGHTAGL_Meters]/ 3.2808399", "VB")
... View more
09-15-2011
05:09 PM
|
0
|
1
|
417
|
POST
|
I want to create an if else statement involving geometry types. If geometry is a point run one process elsif geometry is a line run different process. Is there a way to do this using python?
... View more
09-14-2011
07:50 PM
|
1
|
3
|
10734
|
POST
|
I would like to step back a directory in python without having to prompt the user to do it in my script. For example the user selects a dataset here C:\Projects\test\database.mdb\dataset to run a process on. I then want the database that the dataset is in to be compacted without prompting the user for the database as well. Basically I want to know what the python version of cd.. is
... View more
09-14-2011
02:08 PM
|
0
|
3
|
40196
|
POST
|
That worked perfectly! Thanks so much for your help!!!
... View more
06-22-2011
02:33 PM
|
0
|
0
|
765
|
POST
|
Both MasterDataset and fcs are datasets that users gets to input for the purpose of comparing the feature classes inside them. Any feature classes that are in the fcs dataset that are not in the MasterDataset dataset need to be evaluated. That's why I would like to delete all the feature classes in the fcs dataset that are already in the MasterDataset dataset. I guess I don't need to limit the deletes to feature classes only, but there are no other tables or anything that appear in these datasets or databases. I input the delete tool in model builder and converted it to python and it left the "FeatureClass" in the Delete_management statement so I did too.
... View more
06-22-2011
09:35 AM
|
0
|
0
|
765
|
POST
|
Thanks for the help it definitely got me a lot closer. I decided that instead of printing out a list of the new feature classes in my dataset, that instead I would simply delete out any feature classes that matched those in the master dataset, thus leaving me with only the new feature classes that don't appear in the master dataset. My code runs successfully but it's not doing anything and I'm not sure why. Here is how I wrote it
import arcpy
MasterDataset = arcpy.GetParameterAsText (0)
fcs = arcpy.GetParameterAsText (1)
arcpy.env.workspace = MasterDataset
fclist = arcpy.ListFeatureClasses()
for fc in fcs:
if fc in fclist:
arcpy.Delete_management(fc, "FeatureClass")
... View more
06-22-2011
08:48 AM
|
0
|
0
|
765
|
POST
|
This forum has been a great help to me in creating a couple python tools I really needed to get working. So thanks a ton to the people who have helped me with these. I 'm hoping I can get help with one last tool. I have a master database with a master set of feature classes in it and a new database with most of the same feature classes and a couple new ones. Is there python code I can use to print out a list of just the feature classes names in the new database that don't match any of the feature class names in the master database? Thanks, Phil
... View more
06-22-2011
05:38 AM
|
0
|
7
|
3579
|
POST
|
Yeah, the subtypes are different from one feature class to the next. With what you've shown me in the last few posts though I feel like I have a good shot of figuring this out now. Thanks so much for your help! Phil
... View more
06-16-2011
12:59 PM
|
0
|
0
|
404
|
POST
|
Ideally I want the field already populated when they create a new feature. They will be starting with a blank database with no data (except for the empty feature classes and subtypes built into the database), so I would like to use: arcpy.AssignDefaultToField_management(fc, "Field_Name", User_Input_Value", *Not sure what to put here for the subtypes*) It seems like your code work if I put that in there instead of arcpy.CalculateField_management(fc, "yourfieldnamehere", userinputvalue), but how would I input the subtype values to include all of them for every feature class? Thanks, Phil
... View more
06-16-2011
12:34 PM
|
0
|
0
|
404
|
POST
|
Mike, the field is already there. I have about 30 feature classes that all have a "text" field. I want the user to be able to set the default value of this field in all of the feature classes to whatever value they enter. it will be the same value in all 30 feature classes. Thanks, Phil
... View more
06-16-2011
11:52 AM
|
0
|
0
|
404
|
POST
|
I'm trying to create a python script that will be run in arctoolbox that will allow users to choose multiple feature classes and default the same field in all of the feature classes to the same user entered default value. Is there an easy way to do this? Also if there are different subtypes for each feature class will that be a problem? Currently the default values need to be assigned to the feature class and its subtypes for this geoprocessing tool to work. It would be a pain to have to specify each subtype in a script I think unless there was a way to just automatically include all of them for a given feature class.
... View more
06-16-2011
10:57 AM
|
0
|
6
|
519
|
Title | Kudos | Posted |
---|---|---|
1 | 09-14-2011 07:50 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|