|
POST
|
Well there are not any edits as this was one a coworkers computer and then I tried out a test on an imported table into a new map with nothing else in it. It might be as you stated, just the Geoprocessing version has more information than the shortcut does and that is why it fails...
... View more
08-01-2023
10:35 AM
|
0
|
0
|
1315
|
|
POST
|
I noticed at some point that there is now an option to <Right-Click> on an imported table into a map from say Access or Excel and chose the Display XY Data. This looks exactly the same as the one in ArcToolBox called XY Table to Point. I would think they would be the same thing. However, I keep getting an error when using it. It also shows that the process is the same as the one in ArcToolBox (XY Table to Point (Data Management Tools)). The process works fine if I use the one in ArcToolBox though. So my question is, should these two be the same process and if so, why is the menu version failing, while the ArcToolBox method works fine? Menu version on the left and ArcToolBox on the right for comparrison
... View more
08-01-2023
10:03 AM
|
1
|
4
|
1333
|
|
POST
|
Good to know there are other options like this then...
... View more
03-08-2023
05:32 AM
|
0
|
0
|
1176
|
|
POST
|
@Dan I guess that's all it is then, just a simplified version. I just never realized that until now when I needed the Python code, but like you said, I notice the Environment is also only in the Geoprocessing one as well. Guess I'll have to always keep that in mind with other functions that I use on the ribbon then, that I may be missing out on some features...
... View more
03-07-2023
09:26 AM
|
0
|
0
|
1215
|
|
POST
|
Is there a specifc reason that processes such as Select by Location or Selecty by Attributes, for example, allow you to copy the Python Code from the Run button if you use them through Toolbox, but that option isn't avaliable if you access these through the Map Tab on the Ribbon? I see they do have different ID's (example: esri_geoprocessing_selectByLocationButton and esri_geoprocessing_management_SelectLayerByLocation), but I would think they should be able to have the exact same functionality as each other, unless I'm missing something internally that there is a reason they aren't?
... View more
03-07-2023
08:48 AM
|
0
|
4
|
1228
|
|
POST
|
Yes, it now seems to work. I've just made a few adjustments to only bold the NAME if needed and never the other ones and it works as I originally wanted it. Thanks for that tutorial and guess I put your mind to work a bit too...
... View more
02-07-2023
08:48 AM
|
0
|
0
|
907
|
|
POST
|
Well that seemed to solve that issue, but creates a new one now. I can often have just the WIDTH supplied without a NAME. This code won't display it if there is no NAME given. Also, if I add in a Route and not ALT_NAME, it duplicates the NAME field. This is one interesting things you're trying to solve here ha...
... View more
02-07-2023
07:59 AM
|
0
|
0
|
910
|
|
POST
|
Very odd. So I have tried your code and I get it to work, all except when there is only the NAME being displayed. Then it fails with the '&' and prints out the following: "TEST & TEST" will show up as "TEST &: TRUE" Now if I add an ALT_NAME with or without the '&' it displays both perfectly fine. Or if I add a ROUTE or WIDTH (other than what is in the exclusion) it works perfectly fine. So just the NAME with the '&' fails. This is getting pretty close to the fix though. On another note, being on 3.0.3 myself. I did try with the <ITA> just to see if I get the same issues you did, and I am getting it working for me the exact way you used <BOL>. So odd you aren't getting that working like I am...
... View more
02-07-2023
05:43 AM
|
0
|
0
|
1516
|
|
POST
|
Yes that works the same with the code I just posted earlier and allows the use of the "&". The issue is that it won't allow me to work with Itallics or font changes and that was the issue. I can get away using the code I had, or the one you posted just fine, but I won't have the ability to work with that functionality. Again, it's more just visually appeasing, and not something I really need, but it would be nice to see if it could work with that sort of thing. Here's the example of what I added to your code for just the Width (note I had to rename your WIDTH1 to another name as some data comes in with a Width1 as the name, and searching replacing doesn't work as well like that.) so I just renamed it to WDTH_TMP if WDTH_TMP:
if str(WDTH_TMP).strip() not in (None,"<NULL>","<Null>","","0",0):
width_str = "<ITA>Width = {}'</ITA>".format(str(WDTH_TMP))
str_list.append(width_str) Here's the full code using your example and the itallics and font size changes where having a "&" in the name, still causes that issue displaying the code for itallics, etc as the original issue had. Removing those of course works fine, but I don't get this added visual possibilities is all... (I will be out on vacation for a week so after tomorrow, I'll repond and check out any other suggestions next week.)
... View more
02-06-2023
03:50 PM
|
0
|
0
|
1525
|
|
POST
|
Well for the Width the original code had if WDTH_TMP:
if str(WDTH_TMP).strip() not in ("<NULL>","<Null>","0","Varies"):
width_str = "<ITA>Width = {}'</ITA>".format(str(WDTH_TMP))
str_list.append(width_str) as I need to exclude 0 if it was a numeric field, or exclude text values that show up as "<NULL>, "0", "<Null>" and "Varies". These have been populated in the Width field if the Width was a text field and ones with those values, I didn't want to display at all as a lable if they contained those values...
... View more
02-06-2023
12:58 PM
|
0
|
0
|
1534
|
|
POST
|
Though the problem now is I can't exclude some of the text variables that might show up if that field is a Text rather than Numeric. I have gotten this version of the code to work without any issues. The only problem of course is the labeling features such as font size and Itallics aren't included, but I can deal with that as the "&' in the NAME or ALT_NAME is more important. Thanks for your help though on this again... def FindLabel([NAME],[ALT_NAME],[ROUTE],[WIDTH]):
str_list = []
if [NAME] not in (None, "<NULL>", "", "0"):
str_list.append([NAME])
if [ALT_NAME] not in (None,"<NULL>", "", "0"):
altname_str = '({})'.format([ALT_NAME])
str_list.append(altname_str)
if [ROUTE] not in (None,"<NULL>", "", "0"):
route_str = 'RT# {}'.format([ROUTE])
str_list.append(route_str)
if [WIDTH] not in (None, "<NULL>", "", "0"):
width_str = 'Width = {}'.format([WIDTH])
str_list.append(width_str)
label_str = '\n'.join(str_list)
return(label_str)
... View more
02-06-2023
09:45 AM
|
0
|
0
|
1542
|
|
POST
|
@RhettZufelt , I did run into an issue though. As I mentioned before, the WIDTH can actually be a string in some cases or numeric in other cases. So right now this code works if the WIDTH is a String, but it fails if it's numeric and WIDTH=0. So I've tried to add in just a 0 into the code, but it doesn't seem to ignore that. I've also tried to use the None as well without success. (Note I had to change the name of the Width_1 to WDTH_TMP to make it easier. Here's what I'm trying without success if the value is 0 and WIDTH is actually a numeric field. if str(WDTH_TMP).strip() not in (None,"<NULL>","<Null>","0",0):
... View more
02-03-2023
06:51 AM
|
0
|
0
|
1550
|
|
POST
|
Thanks so much, and I actually used the code block in the past and just forgot how to use it, so thanks for that refresher for my future questions on the forum. I liked how you explained everything and that made it much easier to understand why you changed what you did. Now I can update my document with this and make it a lot more inclusive to the types of naming conventions we get. With the Width, yes we can get just numeric values or such things like "8FT" or "Varies", so I always have to treat that as a text field (I forgot to include the "varies" back into the code, but that's an easy fix). Thanks so much for this help...
... View more
02-03-2023
05:43 AM
|
0
|
0
|
1552
|
|
POST
|
Ok I got the Name part working with the & which is great and thank you for that. In the larger code (which is different than the example I showed you), I am trying to apply that to 2 fields out of 4. In this example NAME and ALT_NAME. I run into issues when trying to do it for a 2nd field. Here's the code that I can't seem to get working. One issue is that you stated the <ITA> and such may not be supported in this fashion, 2nd I can't get this code to work at all regardless of where I place the ALT_NAME1 if statements for the &: def FindLabel([NAME],[ALT_NAME],[ROUTE],[WIDTH]): str_list = [] NAME1=[NAME] ALT_NAME1=[ALT_NAME] ROUTE1=[ROUTE] WIDTH1=[WIDTH] if '&' in NAME1: NAME1=NAME1.replace("&","&") if NAME1 not in (None, "<NULL>","<Null>", "", "0"): str_list.append(NAME1) if '&' in ALT_NAME1: ALT_NAME1=ALT_NAME1.replace("&","&") if ALT_NAME1 not in (None,"<NULL>", "", "0"): altname_str = "<ITA><FNT size = '6'>({})</FNT></ITA>".format(str([ALT_NAME])) str_list.append(altname_str) if ROUTE1 not in (None,"<NULL>", "", "0"): route_str = "RT#: {}".format([ROUTE]) str_list.append(route_str) if WIDTH1 not in (None, "<NULL>","<Null>", "", "0", " "): width_str = "<ITA>Width = {}'</ITA>".format(str([WIDTH])) str_list.append(width_str) label_str = '\n'.join(str_list) return(label_str)
... View more
02-02-2023
01:54 PM
|
0
|
0
|
5285
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 3 weeks ago | |
| 1 | 09-04-2025 10:28 AM | |
| 1 | 01-23-2020 06:33 AM | |
| 1 | 09-09-2024 08:47 AM | |
| 1 | 08-23-2024 12:19 PM |
| Online Status |
Offline
|
| Date Last Visited |
Friday
|