|
POST
|
Another question. I am trying to use the Mid() function in the field calculator. !STR_NAME!.Mid(5, 20) but it gives me a throwback error when I Run it Can someone tell me why?
... View more
10-31-2019
09:18 AM
|
0
|
0
|
2219
|
|
POST
|
What is the conversion in Python for LTrim and RTrim? I would like to use them in my Field Calculator in ArcGIS Pro but they are not there
... View more
10-31-2019
07:36 AM
|
0
|
3
|
2331
|
|
POST
|
Yes this is a script which I will have to run occasionally. I still have ArcMap 10.7 on my computer so I'm not completely devoid of using my old way of running the script in VB. I'm just slowly trying to learn how to do it in Python in case in the future I lose my connection with ArcMap and have to rely on using ArcGIS Pro. Hopefully I never have to get that complex in scripting. That's a clever way of using other programs to figure out how to accomplish a complex task! Cheers!
... View more
10-25-2019
08:34 AM
|
0
|
0
|
1291
|
|
POST
|
Then I just need to learn how to enter it into the prelogic part of the module. Thank you for helping me figure out this issue Robert!
... View more
10-25-2019
08:04 AM
|
1
|
2
|
15132
|
|
POST
|
# Process: Calculate Field (2) arcpy.CalculateField_management(clines__5_, "LABEL", "RTRIM([PRE_DIR]) & \" \" & LTRIM(RTRIM([STR_NAME])) & \" \" & [SUF_FIX]", "VB", "IF RTRIM([PRE_DIR]) = \" \" then\\n MyLabel = LTRIM([STR_NAME]) & \" \" & [SUF_FIX]\\nelse\\n
... View more
10-25-2019
07:58 AM
|
0
|
4
|
15132
|
|
POST
|
I know I have the syntax wrong because I am very unfamiliar with python syntax. I have just been looking at python examples on the internet and doing what I thought would work since what I had in VB works. Here is a screenshot of the Calculate Field module I have in python.
... View more
10-25-2019
07:33 AM
|
1
|
6
|
15132
|
|
POST
|
I know I marked your response as correct and it may be correct but I'm still getting an error when trying to convert my if statement to python. I tried this but it isn't working If (!PRE_DIR!).RTrim() = " " print(!STR_NAM!) + " " + (!SUF_FIX!) else print(!PRE_DIR!).RTrim() + " " + LTrim (RTrim(!STR_NAME!)) + " " + Return !SUF_FIX! Any help would be appreciated! Thanks
... View more
10-25-2019
07:15 AM
|
1
|
8
|
15132
|
|
POST
|
Thanks Robert! I knew there was an easy way to do this. HAHA!
... View more
10-24-2019
08:36 AM
|
1
|
0
|
15132
|
|
POST
|
I had some VB code in one of my Calculate Field modules in modelbuilder. I am trying to convert it to Python Can anybody help me with this? IF RTRIM([PRE_DIR]) = " " then MyLabel = LTRIM([STR_NAME]) & " " & [SUF_FIX] else MyLabel = RTRIM([PRE_DIR]) & " " & LTRIM(RTRIM([STR_NAME])) & " " & [SUF_FIX] end If Thanks
... View more
10-24-2019
08:29 AM
|
0
|
11
|
17069
|
|
POST
|
Thanks for the reply Josh! I would have embedded the screenshots in the post if I knew how.
... View more
10-24-2019
08:26 AM
|
0
|
1
|
2130
|
|
POST
|
Hi all, I am trying to concatenate 3 fields together in an attribute table and Python is only calculating the first field listed in my script. I am trying to do the concatenation in the LABEL field. All I see is the values for DIRPRE
... View more
10-23-2019
11:14 AM
|
0
|
3
|
2260
|
|
POST
|
Excuse my ignorance on this but I am python illiterate. I am working in ArcGIS Pro and I have built a model to create an new feature class and populate the attribute table for that feature class with values from another attribute table. I built the model in ArcMap and it works fine in ArcMap, however, I have ArcGIS Pro now and one of the fields in the attribute table is empty. I know how to copy empty fields in VB but I don't in Python. Can someone help me on how to copy empty fields in Python? Thanks,
... View more
10-23-2019
07:56 AM
|
0
|
0
|
703
|
|
POST
|
I am running the model now as I type with my address feature as a feature class and it seems like it is working. I still see the address layer in the map when I didn't when it was a shapefile. Thank you!
... View more
10-11-2019
08:14 AM
|
0
|
0
|
519
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-02-2025 07:41 AM | |
| 1 | 06-27-2023 11:13 AM | |
| 1 | 04-03-2023 10:14 AM | |
| 1 | 07-14-2023 08:09 AM | |
| 1 | 10-04-2024 06:41 AM |
| Online Status |
Offline
|
| Date Last Visited |
Wednesday
|