|
POST
|
Yes, I refreshed the Toolbox as well as the folder containing the Toolbox. This worked when all the code was in the .pyt. It seems that ArcCatalog is storing the code in the .py in memory and not re-reading it when the .pyt that references the .py is refreshed.
... View more
09-11-2021
09:41 AM
|
0
|
0
|
3218
|
|
POST
|
The split function creates a list, so you could just use the len() function to find out how many lines there are. Counter = len(Content.split("\n")) Might even run a tiny bit faster than iterating over the whole list
... View more
09-10-2021
07:01 PM
|
1
|
0
|
1857
|
|
POST
|
I have incorporated the hack at the bottom of this help page in order to work with python toolboxes in VS. The hack works, but if I make changes to the code of any tool therin, save them and then refresh the toolbox in ArcCatalog, the tool runs the old code. It won't run the new code until I restart ArcCatalog, which is anything but fast. Is there anyway to refresh the toolbox without restarting ArcCatalog?
... View more
09-10-2021
03:44 PM
|
0
|
5
|
3270
|
|
POST
|
Thank you for these links. So the short answer is that I cannot author GP Tools in .NET, and that any such tools have to be completely rewritten in Python.
... View more
01-25-2021
09:30 AM
|
2
|
3
|
6140
|
|
POST
|
Is there any documentation or samples that show how to create a Pro GP tool in .net. Documentation for Arcmap was rather spase and didn't cover .net, but there was a sample for a simple tool. I have not been able to find anything at all for Pro.
... View more
01-22-2021
03:14 PM
|
2
|
8
|
6184
|
|
POST
|
While there are several questions and answers and samples using OpenItemDialog, I haven't found any for SaveItemDialog which is giving me trouble. I need to use this in an Add-In to ask the user for an output location for one or more featureclass(es) that may or may not already exist. If the selected output location is a featureclass then that gets created if necessary and then used, but if it is a workspace, then my code will determine the featureclass name and create it. This works OK if a featureclass name is specified by the user except that the returned FilePath strips off .shp if a shapefile is specified and additional coding is required . But, if a workspace is specified by the user, there are bigger problems: if a filegeodatabase is specified, then the returned Filepath has .GDB stripped off, and if a shapefile workspace (folder) then the "Save" button in the dialog is disabled, as if the dialog doesn't recognize a folder as a workspace, nor does it work using using the esri_browseDialogFilters_folders filter. A second point of confusion is the documentation for the AlwaysUseInitialLocation property. If set to true then the specified InitialLocation is used, but if False then "if not specified, the initial location may be the last location opened using the current filter" May? When or why doesn't it use the last location? Sub testSaveDialog()
Dim pCompFilter As New BrowseProjectFilter
pCompFilter.AddFilter(BrowseProjectFilter.GetFilter("esri_browseDialogFilters_featureClasses_all"))
pCompFilter.AddFilter(BrowseProjectFilter.GetFilter("esri_browseDialogFilters_workspaces_all"))
pCompFilter.AddFilter(BrowseProjectFilter.GetFilter("esri_browseDialogFilters_folders"))
Dim saveItemDlg As SaveItemDialog = New SaveItemDialog()
saveItemDlg.BrowseFilter = pCompFilter
saveItemDlg.Title = "Output location"
saveItemDlg.InitialLocation = "F:\"
saveItemDlg.OverwritePrompt = False
saveItemDlg.AlwaysUseInitialLocation = True
Dim ok As Boolean = saveItemDlg.ShowDialog()
If ok = False Then
MsgBox("Aborted")
Else
MsgBox(saveItemDlg.FilePath)
End If
End Sub
... View more
09-19-2020
12:42 PM
|
0
|
1
|
1160
|
|
POST
|
Thank you for the link! All my searches led to other places that did not have this help file.
... View more
08-26-2020
10:27 AM
|
0
|
0
|
867
|
|
POST
|
For version 2.4 I was able to find a .chm containing the whole reference somewhere. It was excruciatingly slow, but still much more useful than the online HTML version that doesn't have an index to quickly get to the classes you're looking for. A table of contents is fine for reading a book, but not as a reference. Not to mention it doesn't work at all without internet. Is there an SDK reference, with an index, that can be downloaded for version 2.6 ?
... View more
08-25-2020
07:26 PM
|
0
|
2
|
933
|
|
IDEA
|
This all worked like normal windows in ArcView 3.x. Then it went to really bad in ArcGIS 9.x. Unbelievably, it was made even worse in 10.x. And here it is, 2 decades later, and this nonsense persists in all versions of Pro! C'mon, Windows automatically come with a minimize button, programmers have to remove it to create an incredibly annoying UI like this.
... View more
06-09-2020
05:35 PM
|
2
|
0
|
2867
|
|
POST
|
Christopher, Thanks for responding. Yes, I have already studied the "Migrating to ArcGIS Pro" document, In fact I was quite thrilled to find it, and then very disappointed when I looked at the content. "Migration" is not addressed at all, this is truly a "Getting Started" (from scratch) document. For those of us that have spent years learning, developing, and refining our knowledge of customizing ArcGIS UnPro (ArcMap), there is little if anything that helps us apply those hard-won skills to migrating. Clearly, while Pro is a completely different animal and many things are different, there are still many concepts and approaches that are still the exactly the same even if they are just sporting new names and terminology. And yes, what I have been able to do so far has been because of the community samples. Indeed, samples are the lifeblood of a GIS Engineer that needs to have many GIS skills that are not programming related, yet still needs to use programming as just another tool to accomplish a larger task by cobbling together bits and pieces borrowed from samples. I am looking forward to the resumption of real (not online) instructor-led training. I have looked at several of the DevSummit videos, and even paused them to painstakingly copy some code to a file. It would be great if any code from these videos were made available digitally. Please don't mention PDF, the bane of all GIS datahounds.
... View more
06-09-2020
12:58 PM
|
1
|
1
|
4163
|
|
POST
|
Thank you very much, Gintautas! The first suggestion didn't work, but the second one did. It could be further cleaned up as strMsgs += Await QueuedTask.Run(Function() getDefs()) And your suggestion for getting rid of the Async modifier worked a treat. Awesome!
... View more
06-09-2020
09:30 AM
|
0
|
0
|
4163
|
|
POST
|
I'm working on converting some of my ArcMap addins to work in Pro. Rather steep learning curve given that is no ESRI guidance at all on doing this. I have found that you can't do anything with geodatabases without wrapping it into an asynchronous function. I managed to find some sample code and wrote a test addin that lists all the featureclasses in a geodatabase. The code below actually works, but is really messy with the inline defined "lambda" function. I should be able to clean it up with a separate function as in the commented out lines in the code, but am having trouble properly constructing the code. The IDE tells me QueuedTask.run wants an "action" and not the function I passed it, so I don't know where to go from there. I also found that I needed to add "async" to the addin button's onclick override to make it work, but that was a shot in the dark as none of the documentation or samples showed this, so I don't know if this is the proper way to do it. Friend Class Sample
Inherits Button
Dim m_gdbPath As String = "F:\HIES\CnmiImagery\CnmiImagery.gdb"
Protected Overrides Async Sub OnClick()
Dim strMsgs As String = ""
Try
'strMsgs += Await QueuedTask.Run(getDefs())
strMsgs += Await QueuedTask.Run(Function()
Dim msg As String = ""
Using gdb As New Geodatabase(New FileGeodatabaseConnectionPath(New Uri(m_gdbPath, UriKind.Absolute)))
Dim defs As IReadOnlyList(Of TableDefinition) = gdb.GetDefinitions(Of FeatureClassDefinition)()
For Each fdsDef As FeatureClassDefinition In defs
msg += fdsDef.GetName & vbCrLf
Next
End Using
Return msg
End Function)
Catch ex As Exception
MsgBox(ex.Message)
End Try
MsgBox(strMsgs)
End Sub
'Function getDefs() As String
' Dim msg As String = ""
' Using gdb As New Geodatabase(New FileGeodatabaseConnectionPath(New Uri(m_gdbPath, UriKind.Absolute)))
' Dim defs As IReadOnlyList(Of TableDefinition) = gdb.GetDefinitions(Of FeatureClassDefinition)()
' For Each fdsDef As FeatureClassDefinition In defs
' msg += fdsDef.GetName & vbCrLf
' 'Console.WriteLine(TableString(fdsDef As TableDefinition))
' Next
' End Using
' Return msg
'End Function
End Class
... View more
06-08-2020
05:41 PM
|
0
|
6
|
4275
|
|
POST
|
I have noticed that images in a Raster Mosaic are smoothed in ArcMap and rasters in a file are not. This "smoothing" is a display function and I've seen it in other software like Erdas but I don't recall what it was actually called. So, I would like to know if I have any control over whether or not this "smoothing" is applied to a raster layer. There doesn't seem to be anything in the layer properties for it. The image below is zoomed in enough to show pixel edges in the file raster, those edges are blurred away in the Raster mosaic, yet they are both the same resolution. File raster: Raster Mosaic:
... View more
12-11-2019
08:30 PM
|
0
|
0
|
655
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-14-2021 07:05 PM | |
| 1 | 06-09-2020 12:58 PM | |
| 1 | 07-21-2022 05:46 PM | |
| 1 | 02-05-2022 08:16 PM | |
| 1 | 12-21-2021 12:52 PM |
| Online Status |
Offline
|
| Date Last Visited |
07-29-2025
11:30 AM
|