|
POST
|
I am new to ArcGIS Pro, very different from ArcMap. I 've been playing around and trying to get use the new environment. I decided to try a toolbox script that worked in ArcMap (I only installed Pro 2.0.1 i did not add any modules, environments or anything) and I get the following error. Traceback (most recent call last): File "D:\GIS Folder\Python Scripts\ZoomToParcel.py", line 11, in <module> mxd = arcpy.mapping.MapDocument("CURRENT") AttributeError: module 'arcpy' has no attribute 'mapping' Failed to execute (ZoomToParcel). I googled ArcGIS Pro & Python, my apologies I am very confused in some threads i read i need to install python 3.5 and in some indicate that i don't need to.Some threads say i need to add new environments and say i don't need to. I come from ArcMap 10.4.1, I use ArcMap python window and python 2.7.10 IDLE shell. I would like to do the same with Pro. Again i am confused and would like simple instructions on how to get ArcPro python and IDLE Shell working in Pro. I would appreciate any and all the help i can get.
... View more
10-27-2017
02:45 PM
|
0
|
5
|
6035
|
|
POST
|
Yes i meant 'TaxParcels', my bad. I was trying to clean up code before posting.
... View more
10-19-2017
07:11 AM
|
0
|
0
|
1559
|
|
POST
|
I am trying to update points, so say i select 30 points in arcmap and i want to update just those 30 points attributes from the parcels polygons BUT only for those 30 and they it must have "Match" in the Verifi3 field if the feature has "No" or is "Null" i want it to be ignored or just pass. I have the following code it works but it updates all the selected points whether it has "Match" or "No" or "Null". I appreciate the help. import arcpy, os
from datetime import datetime as d
startTime = d.now()
import traceback
arcpy.env.overwriteOutput = True
arcpy.env.workspace = r'C:\Temp\Default.gdb'
ptSelection = "PointsTest"
pointLayer = arcpy.env.workspace + os.sep + "PointsTest"
parcel = 'TaxParcels' #Taxparcels
sjpoints = "In_memory\sjpoints"
poly = "ACCOUNT_1"
Pnt = "Account"
with arcpy.da.SearchCursor(ptSelection , "Verifi2") as cursor:
for row in cursor:
if row[0] == "Match":
#Run the Spatial Join tool, using the defaults for the join operation and join type
arcpy.SpatialJoin_analysis(ptSelection, parcel, sjpoints)
# define the field list from the spatial join
sourceFieldsList = ['ACCOUNT_1', poly,'SiteAddress','SiteNum_1', 'SiteStreet_1','SiteNumSfx_1','Predir_1', 'Postdir_1', 'SiteCity_1', 'SiteZIP_1', 'OwnerName_1','StreetType_1', 'SubName_1'] #,'StreetType_1'
# define the field list to the original points
updateFieldsList = ['Account', Pnt,'SiteAddres', 'SiteNum', 'StreetName', 'SiteNumSfx','Predir', 'Postdir', 'SiteCity', 'SiteZip', 'OwnerName','StreetType', 'SubName'] #, 'StreetType'
# populate the dictionary from the polygon
valueDict = {r[0]:(r[1:]) for r in arcpy.da.SearchCursor(sjpoints, sourceFieldsList)}
with arcpy.da.UpdateCursor(ptSelection, updateFieldsList) as updateRows:
for updateRow in updateRows:
keyValue = updateRow[0]
if keyValue in valueDict:
for n in range (1,len(sourceFieldsList)):
updateRow = valueDict[keyValue][n-1]
updateRows.updateRow(updateRow)
del updateRows
del updateRow
else:
row[0] == 'No'
pass
if arcpy.Exists("In_memory\sjpoints"):
arcpy.Delete_management("In_memory\sjpoints")
... View more
10-18-2017
02:30 PM
|
0
|
4
|
2095
|
|
POST
|
Here is a code i use for similar situations. You need to have a uniqueID for both features layers. from time import strftime
print "Start script: " + strftime("%Y-%m-%d %H:%M:%S")
import arcpy
#Transfer of Multiple Field Values between Feature Classes where there is a 1:1 Match between Field Sets
sourceFC = "Parcels"
#change OID@ to your uniqueID
sourceFieldsList = ['OID@', 'Field_1','Field_2', 'Field_3','Field_4'] # Your Source fields
# Use list comprehension to build a dictionary from a da SearchCursor
valueDict = {r[0]:(r[1:]) for r in arcpy.da.SearchCursor(sourceFC, sourceFieldsList)}
updateFC = "Points"
updateFieldsList = ['OID@', 'Field1', 'Field2', 'Field3', 'Field4'] # your updateFC fields
with arcpy.da.UpdateCursor(updateFC, updateFieldsList) as updateRows:
for updateRow in updateRows:
# store the Join value of the row being updated in a keyValue variable
keyValue = updateRow[0]
# verify that the keyValue is in the Dictionary
if keyValue in valueDict:
# transfer the values stored under the keyValue from the dictionary to the updated fields.
for n in range (1,len(sourceFieldsList)):
updateRow = valueDict[keyValue][n-1]
updateRows.updateRow(updateRow)
del valueDict
print "Finished script: " + strftime("%Y-%m-%d %H:%M:%S")
print "Finished script: " + strftime("%Y-%m-%d %H:%M:%S")
... View more
10-11-2017
10:51 AM
|
1
|
4
|
4526
|
|
POST
|
I am having issues making the logo bigger using launchpad theme in WAB 2.5. I have made the changes that Robert suggested https://community.esri.com/thread/190393-make-applicaiton-logo-larger#comment-707482 but for some reason it doesn't seem to work. I am curious if anyone else has had this same issue or is it just me? I have uninstalled and re-installed 2.5 several times but i get the same results. Here are the steps i have taken. 1. Created an new app (Tester), 2. Clicked on 'Launchpad Theme', 3. Clicked on 'Attribute', 4. Changed the icon, 5. Save the app. 6. Made changes as i describe above.
... View more
10-10-2017
03:34 PM
|
0
|
4
|
2274
|
|
POST
|
I just clicked on 'Launchpad Theme' inside Web AppBuilder for ArcGIS. I created an app (Test2), clicked on 'Launchpad Theme', Clicked on 'Attribute', changed the icon, made changes as i describe above. See attached.
... View more
10-06-2017
02:16 PM
|
0
|
0
|
3180
|
|
POST
|
So i uninstalled WAB 2.5 and reinstalled. Made the following edits but still the logo is small. Edits to C:\arcgis_web_appbuilder_2.5\WebAppBuilderForArcGIS\apps\2\themes\LaunchpadTheme\styles\default\css\launchpad.css a,
a:visited {
color: #3b8fc4;
text-decoration: none;
}
a:hover,
a:visited:hover {
text-decoration: underline;
}
.claro .jimu-widget-header {
background-color: rgba(51,51,51,0.9);
-webkit-border-radius: 25px;
border-radius: 25px;
-webkit-box-shadow: 0 1px 0.5px rgba(0,0,0,0.3), 0 2px 2px rgba(0,0,0,0.2);
box-shadow: 0 1px 0.5px rgba(0,0,0,0.3), 0 2px 2px rgba(0,0,0,0.2);
-webkit-transition: width ease-in 0.1s;
-moz-transition: width ease-in 0.1s;
-o-transition: width ease-in 0.1s;
-ms-transition: width ease-in 0.1s;
transition: width ease-in 0.1s;
}
.claro .jimu-widget-header .logo {
height: 110px !important;
width: 110px;
min-width: 50px;
-webkit-border-radius: 50px;
border-radius: 80px !important;
position: relative;
top: -40px !important;
left: -3px !important;
-webkit-box-shadow: 0 1px 0.5px rgba(0,0,0,0.3), 0 2px 2px rgba(0,0,0,0.2);
box-shadow: 0 1px 0.5px rgba(0,0,0,0.3), 0 2px 2px rgba(0,0,0,0.2);
}
.claro .jimu-widget-header .logo img {
height: 110px !important;
margin: 0 auto;
display: block;
}
.claro .jimu-widget-header .links-icon {
background-color: #262626;
-webkit-border-radius: 50%;
border-radius: 50%;
color: #3b8fc4;
}
.claro .jimu-widget-header .links {
margin-top: 5px;
-webkit-box-shadow: 0 7px 3px -4px rgba(0,0,0,0.3), 0 8px 8px rgba(0,0,0,0.2);
box-shadow: 0 7px 3px -4px rgba(0,0,0,0.3), 0 8px 8px rgba(0,0,0,0.2);
} made edits to C:\arcgis_web_appbuilder_2.5\WebAppBuilderForArcGIS\server\apps\2\config.json "widgets": [
{
"uri": "themes/LaunchpadTheme/widgets/AnchorBarController/Widget",
"position": {
"bottom": 10,
"height": 40,
"relativeTo": "map",
"zIndex": 0
},
"version": "2.5",
"id": "themes_LaunchpadTheme_widgets_AnchorBarController_Widget_20",
"name": "AnchorBarController"
},
{
"uri": "themes/LaunchpadTheme/widgets/Header/Widget",
"position": {
"left": 15,
"top": 37,
"width": 670,
"height": 46,
"relativeTo": "map"
},
"version": "2.5",
"id": "themes_LaunchpadTheme_widgets_Header_Widget_21",
"name": "Header"
},
{
"uri": "widgets/Search/Widget",
"position": {
"left": 377,
"top": 45,
"width": 300,
"zIndex": 1,
"relativeTo": "map"
},
"version": "2.5",
"id": "widgets_Search_Widget_22",
"name": "Search"
},
... View more
10-06-2017
01:42 PM
|
0
|
2
|
6182
|
|
POST
|
sorry i forgot to mention that I did make the changes to the main config.json in the apps folder as well. \server\apps\3\config.json. I created a new app and just added the logo to that app and followed the directions https://community.esri.com/thread/190393-make-applicaiton-logo-larger#comment-707482 but i still get the same results..
... View more
10-06-2017
11:08 AM
|
0
|
4
|
6182
|
|
POST
|
Robert, So i made the update to WAB 2.5 and was trying to the logo bigger on my new apps and followed your suggestion for 2.5 but my logo is still small. any thoughts as to what i am doing wrong? I am editing \server\apps\2\themes\LaunchpadTheme\styles\default\css\launchpad.css. a,
a:visited {
color: #3b8fc4;
text-decoration: none;
}
a:hover,
a:visited:hover {
text-decoration: underline;
}
.claro .jimu-widget-header {
background-color: rgba(51,51,51,0.9);
-webkit-border-radius: 25px;
border-radius: 25px;
-webkit-box-shadow: 0 1px 0.5px rgba(0,0,0,0.3), 0 2px 2px rgba(0,0,0,0.2);
box-shadow: 0 1px 0.5px rgba(0,0,0,0.3), 0 2px 2px rgba(0,0,0,0.2);
-webkit-transition: width ease-in 0.1s;
-moz-transition: width ease-in 0.1s;
-o-transition: width ease-in 0.1s;
-ms-transition: width ease-in 0.1s;
transition: width ease-in 0.1s;
}
.claro .jimu-widget-header .logo {
height: 110px !important;
width: 110px;
min-width: 50px;
-webkit-border-radius: 50px;
border-radius: 80px !important;
position: relative;
top: -40px !important;
left: -3px !important;
}
.claro .jimu-widget-header .logo img {
height: 110px !important;
margin: 0 auto;
display: block;
... View more
10-06-2017
09:22 AM
|
0
|
6
|
6182
|
|
POST
|
Sorry, i am not understanding that line. .strip() removes all whitespace and .lower() and lower() method converts all of the characters to lowercase. Not sure why it's given me that error but thank you very much for the assistance.
... View more
10-05-2017
03:56 PM
|
0
|
0
|
1086
|
|
POST
|
I would have to rename my TOC layer to taxparcels1 & sections. Which i done, i didn't want to do that but that got me passed the error but nothing happened. So that brings me to the other question, do i have to use mxd.saveACopy in order for the taxparcels1 layer to be on top of sections?
... View more
09-08-2017
03:42 PM
|
0
|
2
|
1983
|
|
POST
|
I am trying to move TOC layers with the following python code, seems simple enough. Basically i am trying to move TaxParcels1 layer above the Sections layer of my current mxd but i am not sure why i keep getting the error is it because my layers start with an upper case? Also do i have to save to a new mxd for the layer move to happen? import arcpy
mxd = arcpy.mapping.MapDocument(r"C:\Temp\Split MXD.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0]
for lyr in arcpy.mapping.ListLayers(mxd, "", df):
if lyr.name.lower() == "Taxparcels1":
moveLayer = lyr
if lyr.name.lower() == "Sections":
refLayer = lyr
arcpy.mapping.MoveLayer(df, refLayer, moveLayer, "BEFORE")
#mxd.saveACopy(r"C:\Temp\Split MXD2.mxd")
del mxd Error Runtime error
Traceback (most recent call last):
File "<string>", line 12, in <module>
File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\utils.py", line 182, in fn_
return fn(*args, **kw)
File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\mapping.py", line 1677, in MoveLayer
assert move_c is not None, 'Did not find move layer.'
AssertionError: Did not find move layer.
... View more
09-08-2017
02:42 PM
|
0
|
4
|
2619
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-27-2022 11:37 AM | |
| 1 | 10-31-2023 10:16 AM | |
| 1 | 02-16-2023 01:50 PM | |
| 1 | 08-11-2021 11:13 AM | |
| 1 | 01-06-2021 10:45 AM |
| Online Status |
Offline
|
| Date Last Visited |
09-10-2024
10:42 AM
|