POST
|
Thank you Josh. That makes sense for the first issue. Haven't been able to try it out because it happens randomly and hasn't happened since I posted. Not sure how I would "lose" the active template. For the second issue, Yes, I had snapping on but no inferences. My fabric is not very big but the issue is now happening on every line even the first one. Pro is allegedly multi-threaded, but in reality I think there's only two threads, one for the UI (which runs the parts of the tool in the panel) and the other one that does any data manipulation. So I think you're right in that if the data manipulation takes longer then the UI never gets around to advancing.
... View more
03-30-2023
04:51 PM
|
0
|
0
|
759
|
POST
|
I've found another issue with the align features tool: My parcels documents use two different spatial references in meters as well as feet and thus I have to switch my map between all these. Obviously the features in the parcel fabric are all in the spatial reference, but if my map is not set to fabric's spatial reference then align features doesn't work.
... View more
03-30-2023
04:29 PM
|
0
|
0
|
659
|
POST
|
I'm having some issues using the traverse tool, not sure if these are bugs or "features". I'm using v2.81 Isuue 1: I sometimes loose the polyline, 2PT line, and trace tools that are located below the line where you enter bearing, distance, radius etc. When this happens I can still enter direction and distance, but hitting the enter then moves the cursor to the radius field instead of creating the line. This seems to happen randomly, and the only way to fix it is to restart pro. First picture shows the problem, second one shows the traverse tool as it appears when working properly. Issue 2: Sometimes and randomly, usually after I have entered a number of boundary segments, hitting enter to create the next segment I get the little dialog below that pops up for a few seconds and then you have to hit enter again to advance to the next line. While it still works then. this is a really annoying inconsistency in how the tool works since this dialog normally does not pop up and the cursor moves to the next line automatically.
... View more
03-26-2023
05:03 PM
|
0
|
3
|
839
|
POST
|
Thanks for the reply. I was just contemplating building something that would iterate through all feature-classes in a database and list any defined attribute rules, their types and expressions. Then possibly change a constraint rule to a validation rule as these often seem like a good idea until you discover how disruptive they can be to editing processes and you would rather deal with rule issues after the fact. I'm also trying to figure out how those rules are implemented - a wild guess is that they are stored in a special table in the database, then retrieved and applied in response to some event.
... View more
02-23-2023
02:46 PM
|
0
|
1
|
369
|
POST
|
Does the ArcGis Pro SDK for .Net expose AtrributeRules? I have found some classes in ArcGIS.Core.Data but they only deal with evaluating existing rules and AttributeRule Errors, but nothing on enumerating or examining what those existing rules are. Haven't come across anything in snippets or samples either.
... View more
02-19-2023
05:09 PM
|
0
|
3
|
447
|
POST
|
Thank you for the reply, Wolf. My search did not come up with the post you linked; It gave me an understanding of why this was happening. Seems like a bug only in so far as the EditOperation's ErrorMessage is misleading. Not doing anything when it is not given anything to do isn't really a failure.
... View more
07-21-2022
05:46 PM
|
1
|
0
|
341
|
POST
|
Is there a way to get more information when an EditOperation fails using the SDK? I have an addin that populates a field in a layer with values and it works fine the first time, but fails when I run it again. Further investigation showed that the edit operation works when the existing values are <null>, but fails if the existing values are not null. But more generally, i would like to get a reason when an EditOperation fails. An abbreviated part of my code: EditOperation assignIDEditOp = new EditOperation();
assignIDEditOp.Name = "assignIDEditOp";
assignIDEditOp.SelectModifiedFeatures = false;
assignIDEditOp.SelectNewFeatures = false;
strID += (j + 1).ToString(fmt);
pInsp = new Inspector(true);
pInsp.Load(pLay, pOID);
pInsp["ID"] = strID;
assignIDEditOp.Modify(pInsp);
isOK = assignIDEditOp.Execute();
if (!isOK)
{
MessageBox.Show(assignIDEditOp.ErrorMessage);
}
... View more
07-19-2022
02:18 PM
|
0
|
2
|
376
|
POST
|
Hello Narelle, Thanks for the quick reply! Even on a Sunday! I tried your snippet, and it works, but only sometimes, and would thus introduce a bug into any addin that uses it. I suspected that the pane caption is just a text property of the pane and not tied tied to the map that the pane contains, and a little test proved this to be so. It appears that the default caption is the name of the map, but if the caption is changed after the pane is created then the snippet thinks the pane doesn't exist and creates a new one. Furthermore, I need to be able to make changes to map that is not active, and was intending to use that broken snippet to get at the map. Is there another way to get at a map object since I now can't traverse down the object hierarchy to find it? I understand the reasoning behind the change from some older version you described, but isn't the usual way ESRI deals with that would be to create a lightweight version of the map object that has only a few key properties to identify it plus a method to retrieve the fully populated map object if needed? Also, there is no OpenMapPaneAsync. I'm using 2.8, maybe new in 3.0? But, OpenMapPane does work and apparently doesn't need to be run on the MCT either. The alternative method that you commented out still relies on being able to get a map from a mapProjectItem which only works if the pane is active. mapProjItem.OpenMapPaneAsync();
... View more
06-26-2022
08:18 PM
|
0
|
1
|
589
|
POST
|
Awaiting the LookupMukey function returns a task not, what the function itself returns. In order to get the list that LookupMukey produces you need List<string> strOutput = await helperclass.LookupMukey().Result;
... View more
06-26-2022
03:52 PM
|
0
|
0
|
11050
|
POST
|
I want to be able to open (activate) a MapPane with a specific map if it exists, or create it if it doesn't but can't figure out how to accomplish this. Logically, I can get all the MapPanes with this: var mapProjItems = Project.Current.GetItems<MapProjectItem>(); Each of the MapPanes in there *should* have a map, and if I iterate through there, I can activate the pane if the map's name is the one I want, or create a new one if it is not found. The problem is that only the MapPane that is currently active has a map, for all the others the map property is null. There is a Pro Snippet called "Get the Unique List of Maps From the Map Panes" and it crashes because of the same problem: public static IReadOnlyList<Map> GetMapsFromMapPanes()
{
//Gets the unique list of Maps from all the MapPanes.
//Note: The list of maps retrieved from the MapPanes
//maybe less than the total number of Maps in the project.
//It depends on what maps the user has actually opened.
var mapPanes = ProApp.Panes.OfType<IMapPane>()
.GroupBy((mp) => mp.MapView.Map.URI).Select(grp => grp.FirstOrDefault());
List<Map> uniqueMaps = new List<Map>();
foreach (var pane in mapPanes)
uniqueMaps.Add(pane.MapView.Map);
return uniqueMaps;
} There is another snippet called "Find a map within a project and open it", but it always creates a new MapPane (so then you have two with the same name and map) because of the same problem. And there is also the MapProjectItem.OpenMapPane() method, but it too creates a new MapPane. This should be so simple to do...
... View more
06-26-2022
03:30 PM
|
0
|
4
|
629
|
POST
|
In an addin i'm creating there's a button that will add a raster layer to my map based on a selected value in a listbox. The code is simple and works fine: the new layer appears in the TOC and the image appears on the map, but curiously all visibility checkboxes on layers in the TOC become greyed out for a while. After a minute or so, they become enabled again. I'm guessing something is going on in a background thread that is setting the visibility checkboxes to disabled while it is doing whatever it is doing. The question is what is it doing? The images are around 10mb each and georeferenced. private async void cmd_ButtonAdd_Click(Object sender)
{
Layer pImgLay;
string url = selectedObliqueVal;
url = m_imgPath + m_Isle + m_imgFolder + "A" + url.Substring(1, 1) + @"\" + url + ".jpg";
if (!System.IO.File.Exists(url))
{
MessageBox.Show("File does not exist:\r\n" + url);
return;
}
pImgLay = await QueuedTask.Run(() => { return LayerFactory.Instance.CreateLayer(new Uri(url), MapView.Active.Map); });
_addedImages.Add(url);
//MessageBox.Show("Add");
}
... View more
05-19-2022
01:54 PM
|
0
|
0
|
204
|
POST
|
Yes, you are right! But that error should still restrict the file types to just .xls. After correcting that error, the tool still allows any type of file.
... View more
02-24-2022
11:16 AM
|
0
|
0
|
364
|
POST
|
I created some ArcObjects code that creates a geoprocessing tool that creates a featureclass from some input files. The code creates a GP tool that works as it should, except for one problem: the GP parameter for the input files accepts all files when it is supposed to only accept files with the extension .jxl or .xls. There is no documentation on how to do this, but below is the code snippet of what I wrote to create the input file parameter. I've also converted the tool to a Python tool (which has much better documentation) and it does filter input files to just the allowed ones. I assume the underlying objects are the same for the .Net SDK as for ArcPy, so there should be a way to get the .net authored tool to work as well. I also looked for clues in the Pro SDK, but came up with nothing since Pro doesn't even support creating GP tools with .net. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
parameter = New GPParameterClass()
Dim inputType As IGPDataType = New DEFileTypeClass()
Dim pGXFileFilter As IGxFileFilter = New GxFileFilterClass
pGXFileFilter.AddFileType("jxl", "Trimble JXL Files", "")
pGXFileFilter = New GxFileFilterClass
pGXFileFilter.AddFileType("xls", "Excel Files", "")
Dim pGXFilterInfo As IGxFilterInfo
pGXFilterInfo = CType(inputType, IGxFilterInfo)
pGXFilterInfo.OpenGxObjectFilters.Add(pGXFileFilter)
pGXFilterInfo.SaveGxObjectFilters.Add(pGXFileFilter)
Dim mvType As IGPMultiValueType = New GPMultiValueTypeClass()
mvType.MemberDataType = inputType
Dim mvValue As IGPMultiValue = New GPMultiValueClass()
mvValue.MemberDataType = inputType
parameter.Name = "input_files"
parameter.DisplayName = "Input Files"
parameter.ParameterType = esriGPParameterType.esriGPParameterTypeRequired
parameter.Direction = esriGPParameterDirection.esriGPParameterDirectionInput
parameter.DataType = CType(mvType, IGPDataType)
parameter.Value = CType(mvValue, IGPValue)
pParameters.Add(parameter)
' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
... View more
02-17-2022
03:40 PM
|
0
|
2
|
407
|
POST
|
If you need to do something before the tool is used, then use ActiveToolChangedEvent mentioned, but if what you are doing occurs when the tool actually does something, then just get the active tool - there's only one. Tool currentTool = FrameworkApplication.ActiveTool;
MessageBox.Show(currentTool.Caption);
... View more
02-17-2022
01:20 PM
|
0
|
0
|
270
|
POST
|
Whole new world - maybe. More like a different planet. The "help" is unfortunately rather fragmented: Reference The reference for all the Pro objects. For the most part auto-generated and doesn't give you much more than what intellisense does. Snippets Bits of code to do various things. Very good, but requires a lot of searching through the various categories if you didn't create the SDK and thus don't know what's in all the various SDK assemblies. Samples Lots of very good samples. Requires some editing in wordpad of the .csproj files if you did not install ArcGIS in the default location. The one you want to look at is under "Framework" called DockpaneSimple. It has a couple of listboxes. Pay attention to the Bindings in BookmarkDockpane.XAML for the listboxes, and the corresponding properties in BookmarkDockpaneViewModel.cs That app makes a list of Bookmark names, but can just as easily be some text items you get from your WebResponse. DockPanels don't go away once they are created, so if you want your app to work like a geoprocessing tool and go away once it's done doing it's work, you'll need to add this at the end: DockPane dockPane = FrameworkApplication.DockPaneManager.Find(_dockPaneID);
if (dockPane != null) { dockPane.IsVisible = false; } You can find what _docPaneID for your app is supposed to be in the Config.DAML for your addin.
... View more
02-07-2022
02:07 PM
|
0
|
0
|
768
|
Title | Kudos | Posted |
---|---|---|
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 | |
1 | 09-10-2021 07:01 PM |
Online Status |
Offline
|
Date Last Visited |
02-23-2024
10:01 PM
|