POST
|
I am trying to make an add-in tool for ArcMap that will allow a user to draw a rectangle to export the visible layers in their MXD to shapefiles. I used the Python Add-in Wizard to create my add-in, and I modified the python script that executes the business logic of my tool like this: import arcpy
import pythonaddins
class ToolClass2(object):
"""Implementation for AddinTest20200513_addin.tool (Tool)"""
def __init__(self):
self.enabled = True
self.cursor = 3
self.shape = "Rectangle"
def onRectangle(self, rectangle_geometry):
extent = rectangle_geometry
output_location = arcpy.env.workspace = r'C:\Users\sipes_gene\Desktop\AddinTest20200513'
a = arcpy.Array()
a.add(extent.lowerLeft)
a.add(extent.lowerRight)
a.add(extent.upperRight)
a.add(extent.upperLeft)
a.add(extent.lowerLeft)
boundary_poly = arcpy.Polygon(a)
mxd = arcpy.mapping.MapDocument("Current")
lyrList = arcpy.mapping.ListLayers(mxd)
for lyr in lyrList:
if lyr.visible is True:
out_shp = output_location + str(lyr) + ".shp"
arcpy.SelectLayerByLocation_management(lyr, 'Intersect', boundary_poly, 0, 'New_Selection')
copyFCs = arcpy.CopyFeatures_management(lyr, output_location, out_shp)
arcpy.SelectLayerByAttribute_management(lyr, "CLEAR_SELECTION")
arcpy.RefreshActiveView()
return copyFCs I know I am very close to pulling this off because when I run it in ArcMap it will return the first feature class in my TOC as a shapefile, based on the rectangle I drew, but then it stops and does not proceed to the rest of my feature classes. Somehow my loop isn't working correctly. I'm wondering if I need to put the array inside the loop? #arcpy scripting
... View more
05-13-2020
09:56 AM
|
0
|
1
|
820
|
IDEA
|
I am trying to do this very thing. I have 6 fields in a sidewalk assessment map that I want summed into a 7th field for a total score of the 6 fields. I want this to occur on the fly as values are populated into those six fields. I am assuming nothing has been developed since this thread was created?
... View more
01-14-2020
07:49 AM
|
0
|
0
|
5190
|
POST
|
Has anyone successfully collected data with the Leica Zeno 20 (without RTK) and uploaded the raw GPS data to the NGS' OPUS site? I have Zeno 20s I want to find a cost effective solution for. I do not want to pay $6,250 a year for 5 units to have RTK. Also, I want to see if I can make this work without buying Zeno Office (Leica's Post Processing Software).
... View more
12-02-2019
01:08 PM
|
0
|
1
|
1318
|
POST
|
Has anyone successfully collected data with the Leica Zeno 20 (without RTK) and uploaded the raw GPS data to the NGS' OPUS site? I have Zeno 20s I want to find a cost effective solution for. I do not want to pay $6,250 a year for 5 units to have RTK. Also, I want to see if I can make this work without buying Zeno Office (Leica's Post Processing Software).
... View more
12-02-2019
01:07 PM
|
0
|
0
|
245
|
BLOG
|
Does anyone know of a way to modify the script so that it doesn't copy over duplicate rows every time the script is ran? I have two feature layers, one that holds all of the data, and is accumulated over time as the script is ran every 5 minutes, and another with a filter showing only the events that have been reported in the last 10 minutes. I am noticing that events are getting copied over multiple times and the data set is growing very fast. Thanks!
... View more
07-23-2019
03:38 PM
|
0
|
0
|
11183
|
BLOG
|
I was able to execute the python script, but I am getting the below error. Can you elaborate on how the script is supposed to access and edit the feature layer? fail Stage 1 cannot open 'https://services1.arcgis.com/Hug9pbs2TYetbCha/arcgis/rest/services/Waze_Point_Feature_Layer/FeatureServer' Ok, I figured this one out. I needed to use the individual feature service with its index number at the end. Like this: https://services1.arcgis.com/Hug9pbs2TYetbCha/arcgis/rest/services/Waze_Point_Feature_Layer/FeatureServer/0
... View more
07-11-2019
03:15 PM
|
0
|
0
|
11183
|
BLOG
|
Hello Gee, I love this write up, thanks for sharing? Are you at the UC this year? If so I would love to meet up and see if you can help me quickly set this up. I have made my feature layers and altered the script, but I get the same error that Noorhaizarinie Zaini gets when executing it from Pro. Thanks!
... View more
07-10-2019
05:36 PM
|
0
|
0
|
11183
|
POST
|
Thanks for the tip. Do you know how to bypass urls on the Android kit kat version, and can you get me started in the right direction? Yeah this has been so much fun. We bought 5 of these back in January, and they have been nothing more than paper weights at this point.
... View more
06-28-2019
11:56 AM
|
0
|
1
|
1121
|
POST
|
Cannot connect to my RTK subscription while using the Leica/Collector proxy. I successfully connected to AGOL though the proxy and downloaded a Collector Map. I then tried to connect to my RTK subscripton via 3G data service but couldn't connect. So I removed the APN proxy name and port from the mobile service, and was able to access the RTK subscription, BUT I now cannot access the map I downloaded because I am off of the proxy. Has anyone figured a way around this? Is anyone using an RTK subscription on the Leica Zeno 20 with cell data service and proxy? Has anyone burned, destroyed, or returned their units to the Leica rep yet?
... View more
06-28-2019
11:27 AM
|
0
|
3
|
1121
|
POST
|
We used a document titled "How to fix Esri Collector TLS 1.2 issue on Leica Zeno 20 using Proxy Server method" provided to us by our local Leica rep. We followed the document and are now able to log into Collector for ArcGIS, but our data does not draw or render. The data in question is from an ArcGIS (10.4.1) server on premises, that we publish to. To test whether this has anything to do with our server, we opened up an AGOL map that uses data published to ESRI's cloud (hosted services) and the data DOES render and display. We would like to continue using the services on our ArcGIS server, as it fits into our workflow much better. Does anyone have any advice on how to fix this? Would it matter if the data is published from ArcMap versus Pro? Does our server need a patch? Or does it matter what port on the server we are using? Thanks
... View more
05-22-2019
08:10 AM
|
0
|
2
|
1498
|
POST
|
Holy grail! I finally found it way down there in the JSON! Notice that the id number for the widget matches my previous screen shot. All I have to do is update this URL and it should work!
... View more
12-19-2018
11:58 AM
|
0
|
1
|
860
|
POST
|
Actually, I was mistaken about what URL I updated. I looked for my extra data source widget and found this in the JSON What is the significance DATA_SOURCE_FROM_FRAMEWORK? Is this a variable for all of the layers in my app? Also I will be sure to mark as correct.
... View more
12-19-2018
11:27 AM
|
0
|
3
|
860
|
POST
|
Thanks for the information. How do I access the json file? From within AGOL? I tried accessing through ArcGIS online assistant, but couldn’t find the URLs for those widgets.
... View more
12-18-2018
12:52 PM
|
0
|
6
|
860
|
Title | Kudos | Posted |
---|---|---|
1 | 01-12-2017 02:51 PM | |
1 | 01-13-2017 11:15 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|