|
POST
|
Here is the code for the buttons. I cannot figure out why the one button will not enable/disable. class CleanUpData(object):
"""Implementation for PlanningTools_addin.cleanupdatabtn (Button)"""
def __init__(self):
self.enabled = True
self.checked = False
def onClick(self):
#pass
#pythonaddins.MessageBox('Clean up data button clicked','title',0)
processButton('CleanUpData')
class CreateImages(object):
"""Implementation for PlanningTools_addin.createimagesbtn (Button)"""
def __init__(self):
self.enabled = True
self.checked = False
def onClick(self):
#pass
#pythonaddins.MessageBox('Create images button clicked','title',0)
processButton('CreateImages')
class ReviewMap(object):
"""Implementation for PlanningTools_addin.reviewmapbtn (Button)"""
def __init__(self):
self.enabled = True
self.checked = False
def onClick(self):
#pass
#pythonaddins.MessageBox('Review map button clicked','title',0)
processButton('ReviewMap')
class SetupParcel(object):
"""Implementation for PlanningTools_addin.setupparcelbtn (Button)"""
def __init__(self):
self.enabled = True
self.checked = False
def onClick(self):
#pass
#pythonaddins.MessageBox('Setup parcel button clicked','title',0)
processButton('SetupParcel')
class SetupProject(object):
"""Implementation for PlanningTools_addin.setupprojectbtn (Button)"""
def __init__(self):
self.enabled = True
self.checked = False
def onClick(self):
#pass
#pythonaddins.MessageBox('Setup project button clicked','title',0)
processButton('SetupProject')
... View more
08-04-2017
02:12 PM
|
0
|
1
|
2432
|
|
POST
|
Hello, I have a python addin which has a combobox and a series of buttons. I added some code so that depending upon what's selected from the combobox, the buttons are either enabled or disabled. It's working fine except for one button (cleanupdatabtn). In all cases this button does not enable or disable. I've checked many times and the spelling is correct. I'm at a bit of a loss for what I'm missing, maybe someone can see something here that I don't. Thanks! class ApplicationType(object):
"""Implementation for PlanningTools_addin.applicationtypecmb (ComboBox)"""
def __init__(self):
self.items = ['Community Boundary Change','Development Permit','Disposal of Reserve',
'Land Use Amendment','New Community Proposal','Outline Plan','Road Closure',
'SDAB','Street Name Change','Subdivision','Export Map Window as JPEG']
#self.text = 'Select Application Type'
self.editable = True
self.enabled = True
self.dropdownWidth = 'WWWWWWWWWWWWWWWWWWWW'
self.width = 'WWWWWWWWWWWWWWWWWWWW'
def onSelChange(self, selection):
#pythonaddins.MessageBox(selection,'text in combobox',0)
if selection in ('Community Boundary Change','Development Permit','Disposal of Reserve',
'New Community Proposal','Outline Plan','Road Closure',
'SDAB','Street Name Change','Subdivision'):
setupprojectbtn.enabled = True
setupparcelbtn.enabled = False
reviewmapbtn.enabled = False
createimagebtn.enabled = False
cleanupdatabtn.enabled = True
elif selection == 'Land Use Amendment':
setupprojectbtn.enabled = True
setupparcelbtn.enabled = True
reviewmapbtn.enabled = True
createimagebtn.enabled = True
cleanupdatabtn.enabled = False
elif selection == 'Export Map Window as JPEG':
setupprojectbtn.enabled = False
setupparcelbtn.enabled = False
reviewmapbtn.enabled = False
createimagebtn.enabled = True
cleanupdatabtn.enabled = False
else:
pythonaddins.MessageBox('something is wrong','e',0)
... View more
07-24-2017
08:29 AM
|
0
|
2
|
4583
|
|
POST
|
Hi Dan, They both print the same and are correct. Thanks for the input. Chris
... View more
06-21-2017
11:04 AM
|
0
|
0
|
1810
|
|
POST
|
Hi Rebecca, when setting the path to a variable it does print out correctly. Also, the long path does not have issues in other scripts. I`m wondering if this could have to do with the fact that I have a different mxd open when this script is run which references the `ortho photo mxd`. Both mxds reference the same data_for_item.gdb, wondering if it could be some sort of locking issue. I'm thinking maybe I'll move this script and have it run when the user has the ortho photo mxd open instead. Couple extra mouse clicks for the user, but probably cleaner in the end. Thanks
... View more
06-21-2017
11:03 AM
|
0
|
0
|
1810
|
|
POST
|
Hello, I have the following script: import arcpy
fileno = arcpy.GetParameterAsText(0)
#Define the path of the mxd
mxd_file = 'o:/plan/subdiv/' + fileno + '/' + fileno + '-ortho_photo.mxd'
arcpy.AddMessage('fileno: ' + fileno + ' mxd_file: ' + mxd_file)
mxd = arcpy.mapping.MapDocument(mxd_file)
for lyr in arcpy.mapping.ListLayers(mxd):
if lyr.name == 'roads':
lyr.replaceDataSource('X:/GIS/geo_databases/labelling_features.gdb','FILEGDB_WORKSPACE','roads')
elif lyr.name == 'railways':
lyr.replaceDataSource('X:/GIS/geo_databases/labelling_features.gdb','FILEGDB_WORKSPACE','railways')
elif lyr.name == 'rivers':
lyr.replaceDataSource('X:/GIS/geo_databases/labelling_features.gdb','FILEGDB_WORKSPACE','rivers')
elif lyr.name == 'lakes':
lyr.replaceDataSource('X:/GIS/geo_databases/labelling_features.gdb','FILEGDB_WORKSPACE','lakes')
elif lyr.name == 'proposed_OUTLINE_PLAN_polygon - OP item Site Polygon':
lyr.replaceDataSource('O:/plan/subdiv/' + fileno + '/data_for_item.gdb','FILEGDB_WORKSPACE','proposed_OUTLINE_PLAN_polygon - OP item Site Polygon')
#Remove layer from ortho_photo.mxd
for df in arcpy.mapping.ListDataFrames(mxd):
for lyr in arcpy.mapping.ListLayers(mxd, "", df):
if lyr.name == 'site_polygon':
arcpy.mapping.RemoveLayer(df, lyr)
mxd.save()
del mxd
Result = True
arcpy.SetParameterAsText(1,Result) At line 17 I get the following error when executing: Traceback (most recent call last): File "X:\GIS\LUAM\DEV\Scripts\OtherTypes\FixDataSourcesOP_Orthophoto.py", line 17, in <module> lyr.replaceDataSource('O:/plan/subdiv/LOC2018-0001/data_for_item.gdb','FILEGDB_WORKSPACE','proposed_OUTLINE_PLAN_polygon - OP item Site Polygon') File "c:\program files (x86)\arcgis\desktop10.2\ArcPy\arcpy\utils.py", line 181, in fn_ return fn(*args, **kw) File "c:\program files (x86)\arcgis\desktop10.2\ArcPy\arcpy\_mapping.py", line 680, in replaceDataSource return convertArcObjectToPythonObject(self._arc_object.replaceDataSource(*gp_fixargs((workspace_path, workspace_type, dataset_name, validate), True))) ValueError: Layer: Unexpected error The layer 'proposed_OUTLINE_PLAN_polygon - OP item Site Polygon' is part of a feature dataset called 'data', so I don't know if that may have anything to do with it? Although, I did read that if you are using this command with a feature dataset to just reference the geodatabase and it should work fine. Right now I'm at a bit of a loss regarding this "Unexpected error". Any ideas appreciated. Thanks!
... View more
06-16-2017
01:08 PM
|
0
|
4
|
2424
|
|
POST
|
Another thought, is it possible to determine the centroid of the irregularly shaped parcel/polygon and then place/create a shape (rectangle or maybe square) in the centre of it that is is a certain area? I know this is kind of the opposite type of thinking in that normally we would take a shape and maybe split it then use setbacks, then extrude a tower for example. thanks
... View more
03-20-2017
01:43 PM
|
0
|
0
|
1450
|
|
POST
|
Hello, Is there a way to extrude a rectangular building on a non-rectangular shaped parcel? Thanks
... View more
03-20-2017
10:05 AM
|
0
|
3
|
1887
|
|
POST
|
Also, the locno and year is needed only to determine the network folder where the csv file is.
... View more
03-13-2017
08:14 AM
|
0
|
1
|
2001
|
|
POST
|
Thanks Dan and Curtis. Think I'm going to give some more thought to the process. Probably a better way of I look at it. Thanks!
... View more
03-12-2017
08:41 PM
|
0
|
0
|
2001
|
|
POST
|
Thanks for the reply Dan. The folder has one file named addresses.csv which has a field in it called address which has numerous addresses in it. I did a test before where I hard coded the path to the csv file into the iterator (O:\plan\luam\1p2007\2018\LOC2018-0027\addresses.csv) and it worked fine iterating through all of the addresses. By replacing 2018 with %Year% and LOC2018-0027 with %LocNo% I was hoping to be able to pass different year and locno values into the iterator. I'm assuming the error has to do with %Year% and %LocNo%. Thanks
... View more
03-11-2017
04:36 PM
|
0
|
5
|
2001
|
|
POST
|
Hello everyone, I have the following model. I would like the Iterate Field Values to locate Addresses.csv based on using LocNo and Year in the path. LocNo and Year are both outputs from Get LocNo And Year. It won't run in this manner. This is the error message returned: Any help appreciated, Thanks
... View more
03-10-2017
02:07 PM
|
0
|
8
|
2542
|
|
POST
|
The addin is installed on each machine by double clicking the .esriaddin The buttons on the addin just link to models and script tools stored in the .tbx files which are on the network. Thanks for replying Rebecca. Sent from my iPhone
... View more
03-06-2017
11:21 AM
|
0
|
0
|
2028
|
|
POST
|
While this solution doesn't get at the question around the registry, I'm now using it and it works just fine and probably better in that it doesn't require mucking around with the registry. Thanks Jayanta!
... View more
02-15-2017
01:50 PM
|
1
|
0
|
1152
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-10-2020 03:34 PM | |
| 1 | 02-23-2021 11:53 AM | |
| 1 | 02-16-2021 09:15 AM | |
| 1 | 12-10-2020 07:46 AM | |
| 1 | 01-18-2019 09:54 AM |
| Online Status |
Offline
|
| Date Last Visited |
04-22-2021
04:31 PM
|