POST
|
Hello! I exported a model from modelbuilder to python and am confused about these bits at the beginning: from sys import argv def FeatureClassGenerator(workspace, wild_card, feature_type, recursive) : with arcpy.EnvManager(workspace = workspace): dataset_list = [""] if recursive: datasets = arcpy.ListDatasets() dataset_list.extend(datasets) for dataset in dataset_list: featureclasses = arcpy.ListFeatureClasses(wild_card, feature_type, dataset) for fc in featureclasses: yield os.path.join(workspace, dataset, fc), fc as well as at the end: if __name__ == '__main__': # Global Environment settings with arcpy.EnvManager(): Model(*argv[1:]) I can remove the one at the beginning without seeing an impact, but if I remove the one at the end, the model doesn't run in the python IDE. I never would have written anything like this had I started from scratch. What is happening here? Do I need this in other scripts too? Thank you!
... View more
06-16-2023
05:12 PM
|
0
|
0
|
622
|
POST
|
But wouldn't that create separate Excel tables? And why does it work for .xls then?
... View more
06-16-2023
05:06 PM
|
0
|
1
|
477
|
POST
|
Hello! I have a dataset with a lot of model outputs that ran through an iterator. So it looks a little like this: A1_abc A1_xyz A2_abc A2_xyz A3_abc A3_xyz And so forth, just a bit more complex. Now I want to export the tables with the same "suffix" to one Excel table and I wrote the following into the Python window: arcpy.env.workspace = "(Workspace)" list = [] name = "abc" for fc in arcpy.ListFeatureClasses(f"*{name}"): list.append(fc) list.sort() arcpy.conversion.TableToExcel(list,f"(Output location)\\Location_{name}") I substituted the workspace path the output location path with (Workspace) and (Output location). This works fine, though it returns an .xls file. Now if I try to add an .xlsx at the end to the code so it looks like this: aarcpy.env.workspace = "(Workspace)" list = [] name = "SensEin_o_Ue_VK_1500" for fc in arcpy.ListFeatureClasses(f"*{name}"): list.append(fc) list.sort() arcpy.conversion.TableToExcel(list,f"(Output location)\\Location_{name}.xlsx") It returns an error message: Traceback (most recent call last): File "c:\program files\arcgis\pro\Resources\ArcToolbox\scripts\TableToExcel.py", line 367, in <module> table_to_excel(arcpy.GetParameterAsText(0), File "c:\program files\arcgis\pro\Resources\ArcToolbox\scripts\TableToExcel.py", line 247, in table_to_excel rowUpdated = list(row) TypeError: 'list' object is not callable Traceback (most recent call last): File "<string>", line 6, in <module> File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\conversion.py", line 559, in TableToExcel raise e File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\conversion.py", line 556, in TableToExcel retval = convertArcObjectToPythonObject(gp.TableToExcel_conversion(*gp_fixargs((Input_Table, Output_Excel_File, Use_field_alias_as_column_header, Use_domain_and_subtype_description), True))) File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 512, in <lambda> return lambda *args: val(*gp_fixargs(args, True)) arcgisscripting.ExecuteError: Traceback (most recent call last): File "c:\program files\arcgis\pro\Resources\ArcToolbox\scripts\TableToExcel.py", line 367, in <module> table_to_excel(arcpy.GetParameterAsText(0), File "c:\program files\arcgis\pro\Resources\ArcToolbox\scripts\TableToExcel.py", line 247, in table_to_excel rowUpdated = list(row) TypeError: 'list' object is not callable Failed to execute (TableToExcel). Anyone any ideas why this does not like the .xlsx?
... View more
06-16-2023
03:17 AM
|
0
|
3
|
493
|
IDEA
|
This is very curious indeed, I am not able to do that. Any ideas what the issues might be here?
... View more
04-26-2023
04:46 AM
|
0
|
0
|
455
|
POST
|
Hi, I am (and have been) experiencing the same issue. I am trying to make a duplicate of a polygon via copy & paste special, and this is the result: This does not happen every time, but still regularly. Curiously, if I keep trying, at some point it will work - with no change in my workflow.
... View more
04-26-2023
01:41 AM
|
2
|
0
|
866
|
IDEA
|
@KoryKramer thanks for your answer. I am using ArcGIS Pro 3.0.3. I tried to replicate the problem using several different Layouts in different aprxs. I am unable to drag and drop any layout to any aprx. Very curious. Is this a bug, then?
... View more
04-24-2023
04:34 AM
|
0
|
0
|
487
|
POST
|
Hello! I have recently realised that my surveys started to create two different featured layers. They both have the same name (like the survey), but one has an added "_results" at the end. They seem to be identical. Can anyone tell me why that is happening? The surveys were designed in Connect and I was wondering if I added something wrong somewhere in the XLS form. When viewed in AGOL, this is a difference I can see: Thanks!
... View more
04-21-2023
01:54 AM
|
0
|
2
|
359
|
IDEA
|
When doing advanced calculations with the field calculator (using the Code Block), often I need more than one field for the calculation. Double clicking on the field will add it to the empty line for the calculation (not the code block but the one above): However, after adding the first field, the cursor disappears from the window. I have to take the mouse, click into the field, add a comma and then double-click the next field. It is a small thing but it bugs me every time that I can't just type a comma (or anything else) but need to manually choose the field again.
... View more
04-21-2023
01:50 AM
|
0
|
0
|
368
|
IDEA
|
I often copy old layouts from former projects to build on in order to save time creating the layout. At the moment, I have to insert a new dummy layout so that the "Layouts" folder appears in the Catalog, copy the layout I want, paste it under "Layouts", and then delete the dummy layout. It would be much neater to be able to just drag and drop a layout, similarly to when importing an mxd.
... View more
04-21-2023
12:16 AM
|
0
|
5
|
530
|
IDEA
|
@KoryKramer thank you, that does make it easier. I did not see the Manage tab pop up. Now I know where to look it is alright. Still think it is clunky and confusing especially when you don't know where to look though...
... View more
04-21-2023
12:11 AM
|
0
|
0
|
327
|
IDEA
|
In the field, I very often submit a survey with a geopoint to add notes to a location. Sometimes it can be good to see where I have already submitted a survey. I know I can see this in the outbox map, but it means switching between the outbox and collecting a new point. I would love the ability to integrate the outbox into the map during the collection part, so when I set a new point I see all the submitted points there. Edit: I should add that in the field we often don't have internet connection. I know it is possible to add the feature layer created from the survey to a linked online map in order to see the points. However, I usually work with mobile map packages due to the connection issues. However, since it is possible to see the collected surveys under "Outbox" with the offline map set as a background, I thought it must be possible to integrate this into new surveys.
... View more
04-20-2023
04:43 AM
|
3
|
1
|
236
|
IDEA
|
I find the way to manage styles not very intuitive. When I right-click on a style, for example to delete a symbol from the style, and click on "Manage style", it opens the catalog. On the left, there are all styles, and on the right, I can access the style classes (though it took me a while to find it). However, there is no easy way to switch between point, line and polygone symbols in the style - you have to go back completely and open the style again and then you can choose a different style class. Altogether, I find the style manager pretty clunky and not very easy to work with.
... View more
04-20-2023
04:40 AM
|
0
|
3
|
357
|
IDEA
|
Very often, I have to display administrative data like municipalities, counties or state. This leads to a problem since the legend for a map series is often supposed to be dynamic and only show features visible in the map extent. Since all these areas are displayed as unfilled polygons, if the boundary doesn't happen to be in the map extent it looks as if they aren't visible - but they appear in the legend because they are, they are just not filled. The only way around this is to change the polygons to polylines. I would love an option similar to "Only show features visible in the map extent" that says "Only show features where the polygon boundary is visible in the map extent" (obviously only enabled for polygons).
... View more
04-17-2023
12:07 PM
|
2
|
0
|
151
|
IDEA
|
Quite often, I will have a narrow legend on the side next to my map because it is a standort layout for my company. If I have long labels and long descriptions, and want to display both, it shrinks the font size considerably. Usually, I make dummy layers for the descriptions, and add them separately to the legend. That can get quite tedious though, and it would be much easier to have the option that the descriptions starts below the label. Here is an example how the dummy looks like: Here is how it works otherwise: The dummy is a lot of work, especially if you don't have single symbol but several unique values, since you need to separate them all and create a dummy for them all in order to show them in the right order.
... View more
04-17-2023
11:09 AM
|
1
|
0
|
164
|
Title | Kudos | Posted |
---|---|---|
3 | a week ago | |
3 | a week ago | |
1 | 02-14-2023 02:50 AM | |
2 | 3 weeks ago | |
1 | 08-04-2023 02:05 AM |