POST
|
I have come across several issues with Graphic Element creation in ArcGIS Pro SDK 2.5 - some of them have been in before although they have changed slightly at 2.5. I'll make a question for each one. If I create and then set Name on many graphic elements whilst the layout is open then it crashes ArcGIS Pro - if I do it whilst the layout is closed then it's OK. An unhandled exception of type 'System.NullReferenceException' occurred in ArcGIS.Desktop.Layouts.dll Additional information: Object reference not set to an instance of an object. Layout layout = Project.Current.GetItems<LayoutProjectItem>().FirstOrDefault()?.GetLayout();
for (int i = 0; i < 100; i++)
{
List<Coordinate2D> lineCoordinates = new List<Coordinate2D> { new Coordinate2D { X = i, Y = 0 }, new Coordinate2D { X = i, Y = 100 } };
Polyline polylineTic = PolylineBuilder.CreatePolyline(lineCoordinates);
CIMLineSymbol lineSym = SymbolFactory.Instance.ConstructLineSymbol(ColorFactory.Instance.BlackRGB, 1.0, SimpleLineStyle.Solid);
GraphicElement lineElm = LayoutElementFactory.Instance.CreateLineGraphicElement(layout, polylineTic, lineSym);
CIMElement cimElement = lineElm.GetDefinition();
cimElement.Name = "Line" + i;
lineElm.SetDefinition(cimElement);
} Of course I can close the layout do the work and then reopen... Adam
... View more
02-07-2020
09:06 AM
|
0
|
2
|
530
|
POST
|
Hi Clayton, Thanks for the clarification. Is it on Esri's API road map and if so, near, medium or long term? Adam
... View more
01-31-2020
09:33 AM
|
0
|
0
|
1201
|
POST
|
Hi Clayton, Given that you only say that there is no Tin Editing does that mean there is TIN access - if so where is it? At 2.4 there is FileSystemDatastoreType only for Raster and Shapefile Adam
... View more
01-30-2020
08:17 AM
|
0
|
2
|
1201
|
POST
|
Hi Ahmed, I was not aware you can create field in the Geodatabase library. Could you provide an example please? I thought all creation of feature Classes / Fields was through the geoprocessor. It's why we use the standalone File Geodatabase API where we can as it works way, way faster and is a more "natural" way to make things. Thanks, Adam
... View more
06-10-2019
04:37 AM
|
1
|
1
|
1094
|
POST
|
Hi Uma, Thanks so much - that's great news that Save works in 2.4 which should not be long now for the beta version to be available? I have a similar problem with using the Coordinate System Dialog from the Snippets collection. If I run it without QueuedTask.Run it works fine but if it is in a QueuedTask then the indexing of the coordinate systems never completes and the wait cursor on the Geographic and Projected Systems just goes round forever. Steps to reproduce protected override void OnClick() { QueuedTask.Run( () => { Application.Current.Dispatcher.Invoke(() => { new CoordSysDialog().ShowDialog(); }); }); } Thanks, Adam
... View more
05-02-2019
03:51 PM
|
0
|
0
|
452
|
POST
|
Hi, In a very large code base that has no need for async as every action needs to be run synchronously we have been successful in finessing away async by calling our functionality from within a single QueuedTask.Run. That generally works very well. However if we try and use the Open/SaveItemDialog then we get some issues. Is there any way of making these calls work in the current version and if not would it be possible for Esri to update these calls to function from within a QueuedTask.Run in a future version. OpenItemDialog works in that the dialog is shown and an item can be picked. SaveItemDialog does not work as the Save button does not close the dialog. Both dialogs do not show the initial location. Steps to reproduce. protected override void OnClick() { QueuedTask.Run( () => { Application.Current.Dispatcher.Invoke(() => { new SaveItemDialog().ShowDialog(); }); }); } Thanks, Adam
... View more
05-02-2019
03:24 AM
|
0
|
2
|
558
|
POST
|
Hi Wolf, Thanks so much for your reply and that is very interesting information which may give me a way of accessing the details I need if there is no other option. However, I apologise for not correctly wording my question. I want to be able to access a "side" project whilst in ArcGIS Pro without visually opening the project. In the SDK I can only see Project.AsyncOpen(path) which opens/loads the project within the Pro User Interface. Is there a way from within the ArcGIS Pro SDK to open a project without it opening/loading in the UI? Akin to ArcObjects IMapDocument mxdDocument = new MapDocumentClass(); mxdDocument.Open(path); IGraphicsContainer graphicsContainer = (IGraphicsContainer)mxdDocument.PageLayout; //Do something mxdDocument.Close(); Thanks, Adam
... View more
04-05-2019
04:15 AM
|
0
|
0
|
518
|
POST
|
Hi, I would like to access a Pro Project programmatically without first opening it in the UI. Is this possible? I can see with CIM that there is a CIMGISProject object but it is unclear how to obtain that object from a path. Back in ArcObjects we could open and manipulate an mxd without it being opened in the UI. Thanks, Adam
... View more
04-04-2019
03:22 PM
|
0
|
2
|
597
|
POST
|
Hi, I am using the OpenItemDialog and have looked at all the ItemFilters but I can't see one that allows to pick a certain type of feature eg polygon. This is available in ArcObjects with the GxDialogClass ObjectFilter - for example GxFilterPolyonFeatureClasses It looks like it should be possible as certain geoprocessing tools in ArcGIS Pro filter by type. Is there any way to do this in the current 2.3 ArcGIS Pro SDK? Thanks, Adam
... View more
04-04-2019
06:57 AM
|
0
|
1
|
380
|
POST
|
Hi Luke, Just because I know the answer now doesn't mean I didn't miss that for a long time as well 🙂 Adam
... View more
03-07-2016
05:46 AM
|
0
|
0
|
677
|
POST
|
One of Geoprocessing.ExecuteToolAsync overloads has a parameter called GPExecuteToolFlags set it GPExecuteToolFlags.None Adam
... View more
03-07-2016
04:23 AM
|
1
|
1
|
677
|
POST
|
Hi Luke, No you are not looking in the wrong place. Agreed- all this geoprocessing stuff for basic GDB,FC and Field creation is really, really nasty. It's so slow when you have a few fields to make. Here is how to make a field via GP https://community.esri.com/message/559621#comment-559621 Adam
... View more
03-02-2016
09:26 AM
|
1
|
1
|
2050
|
POST
|
Hi Drew, Thanks for that. It would be great if a future ArcGIS Pro included the same setting for not adding to the current map as ArcGIS. Thanks Adam
... View more
09-01-2015
03:33 AM
|
0
|
0
|
860
|
POST
|
Hi Charles, Thanks for that. I was thinking of something a little more complex. We have products that have similar functionality on AutoCAD, Microstation and ArcGIS. We abstract away the differences by creating an abstract CommonPlatform that binds to an AutoCADPlatform, a MicrostationPlatform, a FileGDb platform or an ArcGISPlatform depending on the underlying product. The plan is that as we add new platforms either from new vendors or updated API's then it is a relatively simple matter of implementing the new platform calls. That's what happened when Microstation recently released a Beta of their new API. Recent AutoCAD can be used async but it's optional anyway. We are adding an ArcGISProPlatform but it's proving a bit painful due to it's async nature but I'm sure we'll get there in the end. 2 separate codebases could be created (in our case 6). Any new updates to our functionality have to be replicated on all codebases. Never been keen on that solution which is why we went with the platform idea. We, probably like many ESRI Partners, are looking at Pro and wondering how best to refactor our codebases in the most efficient and cost effective way possible. Any tips, examples etc that help us towards tha goal will save a monumental amount of time and resources in comparison to us all reiventing the same wheel. Thanks Adam
... View more
08-23-2015
08:57 AM
|
0
|
0
|
832
|
POST
|
Hi Sree, Thanks. Your links did not work but they did give me the clue to find them myself. It would be nice if the snippets were more prominent on the web site. https://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-Geodatabase Thanks Adam
... View more
08-22-2015
07:21 AM
|
0
|
0
|
487
|
Title | Kudos | Posted |
---|---|---|
1 | 03-14-2024 02:06 AM | |
1 | 03-13-2024 01:19 PM | |
1 | 03-12-2024 02:56 AM | |
1 | 08-04-2021 05:01 AM | |
1 | 01-18-2022 02:10 AM |
Online Status |
Offline
|
Date Last Visited |
3 weeks ago
|