|
POST
|
I am migrating an application from ArcObjects that allows a user to define a polygon which is then written to a shapefile. This process can happen numerous times in a session, requiring the shapefile to be deleted and then re-created. In the ArcObjects version of the application, I am able to remove the shape file and create another. I use the IFeatureWorkspaceManage interface with the DeleteByName passing in the DatasetName and am able to delete and re-create the shapefile as necessary. (pWorkspaceManage.DeleteByName(pDatasetname); In the Pro version I remove the shapefile from the Map and then try to remove the shapefile files but am unable due to the .lock files. I need to know the equivalent mechanism in ArcGIS Pro sdk to allow for same shapefile name creation and removal in an ArcGIS Pro session. Any assistance would be appreciated. Thanks
... View more
01-06-2017
09:29 AM
|
1
|
0
|
1678
|
|
POST
|
I believe I have found the resolution to my issue. I discovered the following stackoverflow site that suggested the fix: c# - Visual studio security problems when running projects - Trust levels - Stack Overflow I followed the tip to add [assembly:SecurityRules(SecurityRuleSet.Level1)] to the application's AssemblyInfo.cs file. Thanks to Anthony Langsworth for the answer. I rebuilt the solution and it successfully launched through Visual Studio. Hopefully, there is not more heartburn regarding deployment.
... View more
08-11-2016
02:39 PM
|
1
|
0
|
1139
|
|
POST
|
I am upgrading ArcEngine applications from 10.3 to 10.4.1 and am encountering an error when the RuntimeManager tries to bind to the product code. I have revised the target framework for the application's projects to .net framework 4.5 and assigned the ESRI dll references to false regarding The solution successfully builds, but when I try to run the application through Visual Studio I encounter the following error: "An unhandled exception of type 'System.MethodAccessException occcurred in ......exe Additional information: Attempt by security transparent method '...exe to access security critical method 'ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode)' failed I have included a screen shot of the error as an attachment These Engine applications have been upgraded for numerous versions with out any grief regarding the RuntimeManager binding bit. I am assuming there is something related to the new framework target. Any assistance would be greatly appreciated.
... View more
08-10-2016
09:57 AM
|
0
|
1
|
2253
|
|
POST
|
Jeremy, Thanks for your input. I have been pulled back into ArcObjects efforts and just found my way back to Pro efforts including this forum. If I follow your code snippet, the graphic is being added to the map view. I am interested in adding graphics (symbols and text ) to a layout. Jeff Barrette mentioned adding graphics to a layout won't be available in 1.3 or 1.4. I am hoping this feature will come sooner than later. Thanks again for responding.
... View more
08-09-2016
01:01 PM
|
0
|
0
|
2015
|
|
POST
|
I am looking for a way through ArcObjects to display additional text on the Time Display that appears on the map for time based data. In native ArcMap , I am able to navigate the Time Slider Options window and open the Time Text Appearance dialog. I can add text manually that will appear. However, I have not been able through ArcObjects to programatically achieve this. I have been working with IMapTimeDisplay2 but have not had any luck. This interface seems to only have methods addressing time format. Any suggestions would be appreciated I have attached a jpg that is a screen shot of what I described doing above in native ArcMap. I appended the words additional text to the display on the map. I need to be able to do this programatically. Thanks
... View more
07-19-2016
10:28 AM
|
0
|
0
|
1362
|
|
POST
|
I know this is the Pro SDK forum, but does anyone know if the Runtime supports adding elements to a layout? Thanks
... View more
03-23-2016
08:06 AM
|
0
|
2
|
2015
|
|
POST
|
Alex, Thanks for the suggestion. We do use data driven pages for other efforts that don't require the analytic effort these applications do. Additionally, some of this involves users graphically interacting with the map control. Based off Jeff Barrette's response, this will eventually be part of the sdk. However, I am not familiar with the Pro SDK release schedule, but it sounds at least a year out. Long live AO! Thanks for your time.
... View more
03-22-2016
01:37 PM
|
0
|
0
|
2015
|
|
POST
|
Thanks Alex. As a fellow AO vet, I appreciate your insight. We have numerous Engine and ArcMap applications that rely on the pattern of using the IGraphicsContainer interface associated with the PageLayout. Typically, the apps perform the required analysis and then passes the results along with all of the ancillary layout information (text, text location, map, layout size, symbols etc...) to a method that adds these elements to the layout graphics container. In fact, we have built numerous helper classes that specifically handle adding these elements to a layout graphics collection. Once the layout is 'built', it is exported to whatever format the user specifies. Here is a bit of code to illustrate: public void BuildLayout ( IMxDoc pDoc, IActiveView pActiveView, IMap pMap, string strTitle double[] dblEnvArray...) { DeleteAllGraphElementsExceptMapFrame(pDoc); //method that removes all graphics pDoc.ActiveView.Refresh(); pDoc.PageLayout.Page.Orientation = Convert.ToInt16(intOrient); pDoc.PageLayout.Page.PutCustomSize(dblCustSizeX, dblCustSizeY); pDoc.PageLayout.RulerSettings.SmallestDivision = 1; pDoc.PageLayout.ZoomToWhole(); pDoc.ActiveView.Refresh(); pActiveView = pDoc.ActiveView; // testing calling routine for map to page transformation IGraphicsContainer pGC; pGC = (IGraphicsContainer)pDoc.PageLayout; pGC.Reset(); IElement pElem; pElem = pGC.Next(); IEnvelope pMapEnvelope; pActiveView.Refresh(); while (pElem != null) { if (pElem is IMapFrame) { pMapEnvelope = pElem.Geometry.Envelope; pMapEnvelope.XMin = dblEnvArray[0]; pMapEnvelope.YMin = dblEnvArray[1]; pMapEnvelope.XMax = dblEnvArray[2]; pMapEnvelope.YMax = dblEnvArray[3]; pElem.Geometry = pMapEnvelope; IMapFrame pMapFrame = (IMapFrame)pElem; pMapFrame.MapScale = pMap.MapScale; } pElem = pGC.Next(); } //end while LayoutGeneric.AddTextToLayout(pActiveView, strTitle, 1, 1.5) //calling helper routine to add text ...... Export to PDF..... } public void AddTextToLayout(IActiveView pActiveView, string strTitle, double dblX, double dblY, int intFontSize) { if(pActiveView is IPageLayout) { IGraphicsContainer pGraphicsContainer; ITextElement pTextElement = new TextElementClass();; IPageLayout pPageLayout; ISimpleTextSymbol pTextSym; pTextSym = new TextSymbolClass(); pPageLayout = (IPageLayout) pActiveView; pGraphicsContainer = (IGraphicsContainer) pPageLayout; IElement pElement; IGroupElement pGroupElement = new GroupElementClass(); IPoint pPoint; pPoint = new PointClass(); pPoint.PutCoords(dblX, dblY - 0.1); pTextElement.Text = strTitle; pTextSym.Font.Name = "Arial"; pTextSym.Size = intFontSize; pTextSym.HorizontalAlignment = ESRI.ArcGIS.Display.esriTextHorizontalAlignment.esriTHALeft; pTextSym.VerticalAlignment = ESRI.ArcGIS.Display.esriTextVerticalAlignment.esriTVABaseline; pTextSym.Font.Bold = true; pTextElement.Symbol = pTextSym; pElement = (IElement)pTextElement; pElement.Geometry = (IGeometry) pPoint; pGraphicsContainer.AddElement(pElement,0); pActiveView.PartialRefresh(ESRI.ArcGIS.Carto.esriViewDrawPhase.esriViewGraphics,null,null); } } When looking at the Pro version of the Layout class and the LayoutProjectItem, there does not appear to be any way to add elements to the layout. There are examples of Pro code manipulating elements already present. As we have discussed, the elements collection returned from the layout appears to be read only. Presently, in my Pro efforts, I am reading a 'layout file' (.pagx) into the Project. This layout file only contains the layout dimensions. I was hoping to be able to add the elements I needed to the element collection associated with this layout. I hope I don't have to have a 'boiler plate' layout file for each type of layout I will need to produce, with all of the text and symbols present, with my code only swapping the values. If this is the case, I am not sure how I would handle custom graphics I want to add to the layout that could not be part of the boiler plate layout file(.pagx) approach. Thanks again for your interest.
... View more
03-22-2016
10:31 AM
|
0
|
0
|
2015
|
|
POST
|
I hesitate to ask this question as I fear it will reveal a major part of the new ArcGIS Pro sdk that I probably should already be aware of . Specifically, I have been looking at the various help resources ( sdk reference, snippets, etc...) for an example of adding graphic elements and map surround type objects to a layout through code. Coming from ArcObjects I was looking for a pattern following the familiar ArcObjects IGraphicsContainer. The Pro Layout Snippet examples appear to be confined changing elements already present in the layout. I have looked at the LayoutProjectItem as well the Layout class itself. I can see the method to return Elements from the pro Layout class. However, I have not figured out how to add new elements of even determine whether it is possible. Any assistance would be appreciated.
... View more
03-21-2016
12:55 PM
|
0
|
12
|
6053
|
|
POST
|
Thanks to the help of the Pro SDK Team at the Dev Summit, I found the solution. I was able to reference the ZonalStatisticsAsTable tool in ArcGIS Pro's tool box located at in the application to create the required table. Specifically, the tool I needed lives at: "C:\Program Files\ArcGIS\Pro\Resources\ArcToolBox\Toolboxes\Spatial Analyst Tools.tbx\ZonalStatisticsAsTable" I was able to create the arguments needed in code and pass them to the GeoProcessing.executeToolAsync method Thanks again the Pro SDK Team
... View more
03-18-2016
10:37 AM
|
2
|
0
|
671
|
|
POST
|
While i am quite new to the Pro Party, could it be the message being displayed is telling you to install the 1.2 version of ArcGIS Pro, then install the ArcGIS Pro SDK 1.2?
... View more
03-04-2016
08:45 AM
|
1
|
0
|
1530
|
|
POST
|
Charles, Thanks so much for the reply. I realize with the Developers Conference starting next week, you must be quite busy. As I expected, your response worked like a charm. I had looked around the github pro site, which I think is very well done. However, I assumed the piece I was after would be in the MapAuthoring section (https://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-MapAuthoring) as it contains examples regarding symbolizing. I was a bit surprised that the raster rendering solution would come from the Geoprocessing module. Oh well, plenty to learn. I look forward to next weeks’ sessions. Thanks again
... View more
03-04-2016
08:37 AM
|
0
|
0
|
1467
|
|
POST
|
I am looking for some examples in Pro of how to use the CIMRasterClassifyColorizer, specifically in setting the ClassBreaks to symbolize some GRID raster data. Ideally I was hoping to use a pre-existing .lyr file and import the symbology, but have not been able to determine a way to do that. I have looked at the LayerFactory.Create method, expecting to be able to pass a path to a .lyr file to automatically bring in the proper symbology. I am able to successfully import the .lyr file in the Pro application, so I know it likes the .lyr file. I assume there is a programmatic way to bring in the .lyr symbology. This approach would be ideal as I would not have to mess with all the overhead of building the bits for the CIMRasterClassifyColorizer. The attached file is a screen shot of the raster legend I am looking for. Any assistance would be greatly appreciated.
... View more
03-03-2016
09:25 AM
|
0
|
2
|
2861
|
|
POST
|
I am transitioning an application from ArcObjects/Desktop to ArcGIS Pro using the ArcGIS Pro SDK. The application works with GRID data and relies on the ArcObjects' classes RasterZonalOpClass as well as the ZonalStatisticsClass, ultimately generating zonal statistics as a table. In ArcGIS Pro I have discovered the equivalent user tool within the ArcGIS Pro Application, "Zonal Statistics As Table". I have seen the Python code example, but I want to implement everything through the Pro SDK. I need to know where to go in the Pro SDK to find out how I can run the same functionality. Any information would be appreciated.
... View more
03-01-2016
08:29 AM
|
0
|
1
|
2200
|
|
POST
|
Thanks Dominique. I had not looked at the LayerList Sample. Your comment about the CanExecute method helped me see the error of my ways. Thanks again for your response.
... View more
12-02-2014
08:03 AM
|
0
|
0
|
575
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-06-2017 09:29 AM | |
| 1 | 03-04-2016 08:45 AM | |
| 1 | 08-11-2016 02:39 PM | |
| 3 | 07-16-2018 10:11 AM | |
| 1 | 07-28-2017 11:06 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|