POST
|
I agree about the parentheses. As my original post indicated, the code was untested. The post was intended to show the structure of how I typically tackle this kind of problem, but I must not have had time to design a real world test case to do an actual debug of the code at that time. Anyway, I hope you have gotten what you needed.
... View more
01-31-2024
11:17 AM
|
1
|
0
|
335
|
POST
|
As I recall, the sorted function may fail if any value it is trying to sort is None, since the sorted function must compare all values to each other to determine the order of the values, and None cannot be compared to other actual values the way that underlying function is written. Since one of the fields making up your tuple key is a date field I imagine it can contain None values. In any case you could print the keys prior to the sorted function to determine what the actual key values are to see if this may explain the code behavior. You can try using a value substitution in your list comprehension as shown in the top reply to this post: https://stackoverflow.com/questions/30976124/sort-when-values-are-none-or-empty-strings-python
... View more
01-31-2024
10:26 AM
|
2
|
4
|
361
|
IDEA
|
Thank you for implementing this enhancement and the video demonstrating how it works. The behavior is much more like the way the Create Features template works and it makes it much easier to quickly create a set of single course features that all need to be classified using the same attribute/symbology.
... View more
10-06-2023
11:39 AM
|
0
|
0
|
480
|
IDEA
|
@MichaelVolz I have not used services in any of my workflows and am retiring next week, so you will have to do the experimentation on that yourself.
... View more
09-30-2023
10:23 AM
|
0
|
0
|
586
|
IDEA
|
@MichaelVolz I have not done a lot of experimentation to determine the best available options for overcoming this problem under the current ArcGIS Pro limitations. I can say none of the options appear to be worth the effort unless the tool is transferring the shape of the source feature to the target or the number of attributes being transferred is very large and difficult to transfer using standard manual value copy and paste operations between attribute tables. I have found that the tool respects layer definition queries, so if a query can be written to ensure that the desired source or destination feature is available to be clicked and all other overlapping features are filtered out is a possible solution if the user is careful not to click the boundary of multiple features. This assumes the user anticipates that overlapping features would otherwise occur and can figure out a query that ensures only a single desired featured is clicked. The tool won't alert the user if they actually still had overlapping features exposed to the tool in their layer, so it is wise to first verify that only the desired features are clicked using the Explore tool first before doing any transfers. Some suggested definition queries that may be useful for restricting the available source or destination features include setting the area or length of the features to be less than or greater than a certain size or setting the ObjectID to be above a certain value. Other query options would be specific to the data the user is working with. For example, in some cases setting the available features to be above a certain date in a date field or greater that a certian alphabetical value in a text field could work. The user still has the responsibility to verify that only the desired source or destination layers are selectable and only the desired destination layer is editable before doing the transfer and should avoid having more than one tranfer set up configured at a time. If I discover any other options, I will post them here, since even if Esri adds equivalency to a future release of ArcGIS Pro they won't implement it in any of the other releases for users that are not ready to update their release.
... View more
09-30-2023
09:55 AM
|
0
|
0
|
593
|
IDEA
|
I also should mention that if multiple Attribute Transfer mappings have been set up that the number of dialogs that can appear for both the source and destination features can increase if the user cancels these dialogs to bring up another transfer mapped feature set. Pressing the escape key can also cycle through the available source features when a single source feature is clicked and the dialog doesn't appear, but this is not true when a single feature is clicked in the first available target layer. This behavior can also occur when a feature class in the transfer mapping set up is used for multiple layers containing different definition queries which can lead to multiple dialogs appearing if the user cancels any of the dialogs and features in any of the other layers were clicked. The dialogs appear in the Table of Contents order of the available sources or destinations beginning with the top most layer and continuing to the lowest layer clicked that is used by the transfer set ups. It may be difficult to replicate this behavior in a single dockable window, which is typically the favored approach for tools in Pro as opposed to using multiple dialogs, which is the favored approach in ArcMap desktop. However, in order for true equivalency to be achieved, these behaviors are additional requirements that the ArcGIS Pro version of the Attribute Transfer tool needs to provide. Obviously as the complexity of the transfer set up configurations increase, the user must assume greater responsibility to understand the tools possible behaviors and spend more time controlling the selectable layer and editable layer settings to manage their edits, but without the behavior I described in my original post, the tool becomes next to impossible to use when multiple features are clicked in a single layer in ArcGIS Pro even with the absolutely simplest transfer set up configuration in place.
... View more
09-30-2023
08:55 AM
|
0
|
0
|
604
|
IDEA
|
The Attribute Transfer Tool behavior in ArcGIS Pro is not equivalent to the behavior of this tool in ArcMap Desktop. The tool behavior is only equivalent when the user's clicks on a single feature for both the source and the transfer targets, in which case no dialogs appear in either program. However, if the user ever clicks on more than one feature for either the attribute transfer source feature or destination feature in ArcMap Desktop, a dialog listing the features by their layer Display tab expression that provides access to a list of feature attributes appears to allow the user to select the exact feature they want to use as the source or destination feature. Clicking on more than one feature can occur when a user clicks on the boundary between two adjacent features in feature classes that aren't designed to have actual overlapping features and can't be avoided in feature classes that are designed to have overlapping features. An example of the dialogs that appear in ArcMap Desktop when more than one feature is clicked for either an attribute transfer source feature or destination feature is shown below: In ArcGIS Pro when the user clicks on more than one feature for the source or the target no dialogs appear and the tool always uses the feature with the lowest ObjectID to do the transfer. If the user didn't want to use the feature with the lowest ObjectID for either the source or the target, the tool behavior nonetheless does a transfer based on that rule and results in data corruption. The ArcGIS Pro version of the Attribute Transfer tool needs to provide an option for the user to choose the source or destination feature they want whenever they click on more than one feature that provides the same functionality that the ArcMap Desktop Attribute Transfer tool dialogs above provide.
... View more
09-28-2023
01:23 PM
|
13
|
7
|
688
|
POST
|
The overall file geodatabase is still compatible with ArcCatalog/ArcGIS Desktop, but the individual feature classes and datasets within it can be rendered incompatable with the enhanced features listed by Ayan. While all editing has to be performed in ArcGIS Pro to take advantage of the enhanced capabilities as intended by the data designer, it is still possible to create a simple feature class in that file geodatabase or in SDE that duplicates the schema without the enhanced capabilities and use the Truncate and Append tools in ArcGIS Pro to create a feature class that can be opened in ArcCatalog/ArcMap for a version of the feature class used for viewing publication only purposes. Of course it then has to undergo scheduled updates to periodically be synchronized with the edit version thereafter and cannot otherwise remain current with the edit version.
... View more
09-09-2023
08:42 AM
|
1
|
0
|
435
|
POST
|
I have a question about using transparency on the text element. Can you tell me where the text element transparency is exposed through the ArcGIS Pro interface? I am unable to find where the transparency property of the text element is set. It does not appear on any ribbon when I select the element that is set to 100% transparent, nor does a transparency property appear within the Text Symbol properties of the text element on the Element tab when I select a text element. I am asking, because I need to manually change the set up the template layout to make all items visible with black text color, but I wanted to also be able to manually set the transparency of the items that I wanted to be opaque or transparent for a specific layout. I prefer to not set the Visible property of the elements to false, since then they cannot be selected on the layout itself. They can only be accessed through the Contents pane for the layout if the Visible property is set to false. The Transparency property allows me to select the elements on the layout, but I don't see where to set it manually.
... View more
05-15-2023
12:22 PM
|
0
|
0
|
557
|
POST
|
Based on the code you provided I have created the following method that finds the text element by the name that is passed to the method and sets the transparency to the value that is passed: public async static void SetTextTransparency(string ElementName, int TextTransparency)
{
// Ensure TextTransparency is within transparency bounds
if (TextTransparency < 0) TextTransparency = 0;
if (TextTransparency > 100) TextTransparency = 100;
var myLayoutView = LayoutView.Active;
if (myLayoutView == null) return;
await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
//Reference and load the layout associated with the layout item
Layout lyt = myLayoutView.Layout;
if (lyt == null) return;
//Reference a text element by name
TextElement txtElm = lyt.FindElement(ElementName) as TextElement;
if (txtElm == null) return;
//Change TextProperties
var cimSym = txtElm.GetDefinition();
cimSym.Visible = true;
var cimTextGraphicBase = (cimSym as CIMGraphicElement).Graphic;
if (cimTextGraphicBase == null) return;
cimTextGraphicBase.Transparency = TextTransparency;
txtElm.SetDefinition(cimSym);
});
} I have also rewritten my method for setting the text value to follow a similar coding pattern to make sure that the process of checking for null values is more thorough.
... View more
05-15-2023
10:39 AM
|
1
|
1
|
566
|
POST
|
I am trying to convert an ArcObjects tool written in VB to an ArcGIS Pro SDK tool written in C#. One of the subroutines of my ArcObjects passes a layout graphics container and a text element name on the layout to make the text color black and another subroutine is passed the same kinds of parameters to change the text color to null (invisible). Here is the ArcObjects method for making the color of the text black: Private Sub setTextElementBlackColor(ByVal pGraphicsContainer As ESRI.ArcGIS.Carto.IGraphicsContainer, ByVal strElementName As String)
Dim pActiveView As ESRI.ArcGIS.Carto.IActiveView
Dim bFound As Boolean
Dim pElement As ESRI.ArcGIS.Carto.IElement
Dim pElementProperties As ESRI.ArcGIS.Carto.IElementProperties2
Dim pTextElement As ESRI.ArcGIS.Carto.ITextElement
Dim pTextSymbol As ESRI.ArcGIS.Display.ITextSymbol
Dim pColor As ESRI.ArcGIS.Display.IColor
pActiveView = pGraphicsContainer
pColor = New ESRI.ArcGIS.Display.RgbColorClass
pColor.NullColor = False
pColor.RGB = RGB(0, 0, 0)
pTextSymbol = New ESRI.ArcGIS.Display.TextSymbolClass
'Element Search escape variable
bFound = False
pGraphicsContainer.Reset()
pElement = pGraphicsContainer.Next()
Do While Not pElement Is Nothing
pElementProperties = pElement
If pElementProperties.Name = strElementName Then
If TypeOf pElement Is ESRI.ArcGIS.Carto.ITextElement Then
pTextElement = pElement
pTextSymbol = pTextElement.Symbol
pTextSymbol.Color = pColor
pTextElement.Symbol = pTextSymbol
pActiveView.PartialRefresh(ESRI.ArcGIS.Carto.esriViewDrawPhase.esriViewGraphics, Nothing, Nothing)
bFound = True
If Not pTextSymbol Is Nothing Then
System.Runtime.InteropServices.Marshal.ReleaseComObject(pTextSymbol)
End If
If Not pTextElement Is Nothing Then
System.Runtime.InteropServices.Marshal.ReleaseComObject(pTextElement)
End If
End If
End If
If bFound = False Then
pElement = pGraphicsContainer.Next()
Else
pElement = Nothing
End If
If Not pElementProperties Is Nothing Then
System.Runtime.InteropServices.Marshal.ReleaseComObject(pElementProperties)
End If
Loop
If Not pColor Is Nothing Then
System.Runtime.InteropServices.Marshal.ReleaseComObject(pColor)
End If
If Not pActiveView Is Nothing Then
System.Runtime.InteropServices.Marshal.ReleaseComObject(pActiveView)
End If
End Sub What is the equivalent code in the ArcGIS Pro SDK for changing a layout text element to black or invisible? I have a method for changing the text of a TextElement, but the TextProperties of the element do not include any way to change the text color. Presumably the code would be similar to that code for changing the text element color, but I do not see any sample code in the git hub examples that tells me how to access the color properties of the text element. Here is the code I use to change the text value of the TextElement: public async static void SetTextElement(string ElementName, string TextValue)
{
await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
//Reference and load the layout associated with the layout item
Layout lyt = LayoutView.Active.Layout;
if (lyt != null)
{
//Reference a text element by name
TextElement txtElm = lyt.FindElement(ElementName) as TextElement;
//Change TextProperties
TextProperties txt_prop = txtElm.TextProperties;
txt_prop.Text = TextValue;
txtElm.SetTextProperties(txt_prop);
}
});
}
... View more
05-15-2023
08:46 AM
|
0
|
4
|
592
|
POST
|
I have been trying to use code to call ArcObjects for ArcMap 10.8 from within Python based on various code examples on the web and so far all of them aren't working. So, is it possible to use ArcObjects for ArcMap 10.8 within Python, or does that only work for earlier versions of ArcMap? I have tried installing comtypes and using the first example from this website: https://gist.github.com/AlexArcPy/bf0f1702d6b0d3840f43442a2d5ef5c6 However, although I have changed the path to match my version of ArcMap, the code fails on the line 12 with a "WindowsError: [Error -2147024809] The parameter is incorrect" error when it tries to execute: esriFramework = GetModule(r"C:\Program Files (x86)\ArcGIS\Desktop10.8\com\esriFramework.olb") I also tried using the library on NuGet called UnmanagedExports from Robert Giesecke from https://www.udcus.com/blog/2017/06/27/extending-arcpy-increased-capabilities-arcobjects-and-c However that code fails when I try to run the Python Example Call Function saying that the dll I built does not have a function called "CustomPost" and doesn't even try to execute anything from the dll. I had made sure the x86 build type is selected in the Target Platform of my project properties. I read elsewhere that the UnmanagedExports library is not compatible with Visual Studio 2017, which is the minimum version required by the ArcMap 10.8 SDK. So, is it no longer possible to call ArcObjects for ArcMap 10.8 from within Python?
... View more
01-26-2023
06:36 PM
|
0
|
0
|
357
|
BLOG
|
On September 28, 2022, I released a new version of my Add-In that added an option to search for Township Range and Section(s) within Riverside County. This is how the tool looks: If you only want to find a single Section you can use the keyboard to do all the steps. Type the number of the Township you want (Example 2) and press the Tab key Type the number of the Range you want (Example 6) and press the Tab key. Optionally you can toggle the slider button to change the W and E Direction of the Range by pressing the Enter or Space key and press the Tab key The grid will change at each of the above steps and if any Sections do not fall within Riverside County they will be disabled. Type the number of the Section you want (Example 28) and press the tab key - the number you typed will blank out and the appropriate Section toggle button within the central Township and Range of the grid will be selected (if it is valid in Riverside County). The Launch button will now have focus and you can press the Enter key or Space key on your keyboard to activate the Launch button and zoom to the Section. If you only want to use the mouse you can Left Click on the Township and Range combobox dropdowns and the Slider Button for W and E to chose the Township and Range you want. To select one or more Sections in the grid with the mouse there are several options: You can do a single Left Click on one of the Section toggle buttons to select it and deselect all other selected toggle buttons. If you do a single Left Click while holding the Shift Key on the Keyboard you can select additional Section toggle buttons individually without affecting any selected toggle buttons that you didn't click. If you do a single Left Click while holding the Control Key on the Keyboard you can invert the selection of each Section toggle button individually (if it is unselected, it becomes selected or if it is selected, it becomes unselected). This does not affect any selected toggle buttons you didn't click. You can Left Click, Drag and Release the Left mouse button to select a rectangular group of Section toggle buttons and deselect any selected toggle buttons that are outside of the rectangle. When dragging in the mode the rectangle appears like this: You can Left Click, Drag and Release the Left mouse button while holding the Shift Key on the Keyboard to select all of the Section toggle buttons that fall within the rectangle you drew. The Section toggle buttons that were selected that are outside of the rectangle will be unaffected. When dragging in this mode the rectangle appears like this: You can Left Click, Drag and Release the Left mouse button while holding the Control Key on the Keyboard to invert the selection of Section toggle buttons within the rectangle you drew. The Section toggle buttons that were selected that are outside of the rectangle will be unaffected. When dragging in this mode the rectangle appears like this:
... View more
09-28-2022
11:54 AM
|
3
|
0
|
382
|
BLOG
|
I am releasing the 1.1.1 version of an ArcGIS Pro Search Tool for Riverside County that in this release includes eight (8) of the Search options available in the ArcMap version posted in my Blog here. The Searches include Search by: Street Intersection APN (Assessors Parcel Number) PLUS Case (Planning and Land Use System) Assessors Subdivision Name/Number or Assessors Recorders Type Book/Page Survey Map Subdivision Name/Number or Survey Map Recorders Type Book/Page. Township, Range and Section(s) (Released - 9/28/2022) Before installing the Add-In, if you have installed any previous version of the Add-In you need to uninstall the prior version first. Open ArcGIS Pro and open the Project Settings page by doing one of the following:. Before opening an ArcGIS Pro project click the Setting button in the lower left-hand corner of the screen: After opening and ArcGIS Pro project click the Project tab in the upper left-hand corner of the screen: Click the Add-In Manager menu item on the left hand side of the Project Setting page Click on the RivCoSearchForms Add-In in the list of My Add-Ins You can verify the version is out of date by reviewing the Date and Version information prior to removing the Add-In Click on the Delete this Add-In button at the bottom right-hand corner of the screen The Add-In will still appear in the list of My Add-Ins until you close ArcGIS Pro, but it will say it is Deleted: After removing the Add-In you must close ArcGIS Pro before you install the new Add-In.. To Install the Add-In download the attached RivCoSearchForms.zip file. Extract and double-click the RivCoSearchForms.esriAddIInX file. Press the Install Add-In button on the Esri ArcGIS Add-In Installation Utility dialog. The press the OK button on the Installation succeeded notification Esri ArcGIS Add-In Installation Utility dialog. Open ArcGIS Pro and open or start a project or you can use the "Start without a template" option. An Add-In tab will have been added to your project, which you can use to choose the Search Option you want and press the cat face Search button to open the search dialog. Open or create a Map or 2D Layout in your project prior to using the cat face search tool. The search tool will verify that your current active map has the layers the tool requires. If necessary it will add them to the map provided that the tool is able to create a Database Connection to the SQL Server Database Platform using the RCIT-19GISP01 Instance with Operating System authentication using the GDB_PUB Database. If you cannot directly connect to Riverside County's GIS data server, but have obtained copies of the appropriate Riverside County Feature Classes in your own geodatabase, you can create the necessary layers by adding the following feature classes to your map and renaming the layer it creates with the layer name shown below: Feature Class Name - Layer Name CENTERLINE_INTERSECTIONS - Search Intersections ADDRESS_POINTS - Search Address Points PARCELS_CONDOS_CREST_VW (or PARCELS_CREST) - Search Parcels PLUS_ACTIVITIES_MODIFIED (or PLUS_ACTIVITIES) - Search PLUS Cases RECORDED_MAPS - Search Survey Maps ROADBOOK_PAGE_INDEX - Search Road Book Page SECTIONS - Search Sections ADDING THE SEARCH TOOL ADD-IN BUTTON AND COMBOBOX TO THE QUICK ACCESS TOOLBAR For easy access to the tool you can add the Search button and combobox for search options to the Quick Access toolbar as a onetime set up. Do the following: Dropdown the Customize Quick Access Toolbar menu as shown and press the Customize the Ribbon option. In the Options dialog scroll to the bottom of the list on the left side of the dialog and press the Quick Access Toolbar option. In the Customize the Ribbon combobox in the Options dialog choose All Commands Type search into the textbox dropdown and choose the Open Search Choice button and press the Add button and then choose the Search (Extended Caption) combobox and press the Add button. The list of tools should look like the items shown below and press the OK button The Quick Access Toolbar should now look like this. Choose the search you want in the dropdown and press the Cat button to launch the search dialog. If you have any questions, please post them here. This Blog will be updated as I release expanded or updated versions of the Search Tools and the date time of each revision publication will be added to the list at the bottom of this blog post. Originally published version 1.0 by Richard Fairhurst on September 20, 2022 at 4:07 PM PST. Updated the Add-In zip file to make improvements to the validations performed in response to user data entry in the APN Search dialog. Published by Richard Fairhurst on September 21, 2022 at 9:30 AM PST. Updated the Add-In zip file to version 1.1 to add a new Township, Range and Section(s) Search dialog option. Published by Richard Fairhurst on September 28, 2022 at 10:38 AM PST. Updated the Add-In zip file to version 1.1.1 to change label placement properties of the Standard Label Engine to label each feature part when the Search layers are added to the map. Published by Richard Fairhurst on October 2, 2022 at 4:45 PM PST.
... View more
09-20-2022
04:12 PM
|
5
|
2
|
1099
|
IDEA
|
@ChrisFoxI had never tried the SQL syntax you outlined, but this expression does work in ArcMap and ArcGIS Pro for related data in the same geodatabase. This syntax is only briefly discussed in the Subqueries section of the SQL reference for query expressions used in ArcGIS website. That section doesn't include an example that was quite as clear or useful to me as the one you have given. I frankly would like to see your example added to that section, since if it had been there years ago I would have been much more likely to see the usefulness of this approach and not had to develop some of the workarounds I came up with. Your example works for file geodatabases as well, despite the warning that file geodatabases only offer limited support for subqueries. The Subqueries section basically says that help for using them is specific to the DBMS documentation of my enterprise geodatabase. Since I've mostly worked with file geodatabases that limitation warning had kept me from even trying to figure out or use Subqueries, but based on the example you have outlined I believe I actually now have a use for them. Thanks.
... View more
09-15-2022
02:40 PM
|
0
|
0
|
581
|
Title | Kudos | Posted |
---|---|---|
1 | 03-12-2015 08:00 AM | |
1 | 01-31-2024 11:17 AM | |
2 | 01-31-2024 10:26 AM | |
1 | 07-20-2018 02:10 PM | |
13 | 09-28-2023 01:23 PM |
Online Status |
Offline
|
Date Last Visited |
01-31-2024
07:18 PM
|