16

In Visual Studio 2013, to fix this check Use Managed Compatibility mode in VS2013 > Options > Debugging > General (last option in the list). Original answer by Preston McCormick here


13

I assume you have installed comtypes successfully, according to the following SE Q/A: How do I access ArcObjects from Python? Code import arcpy from snippets102 import * from comtypes.client import GetModule, CreateObject import comtypes.gen.esriFramework as esriFramework import comtypes.gen.esriArcMapUI as esriArcMapUI import comtypes.gen.esriCarto as ...


12

We had a big need for a similar capability and ended up building a general, free, open source Python library for the purpose. You can find it at https://github.com/ucd-cws/arcpy_metadata or by running a "pip install arcpy_metadata". There is some documentation of features and how to use it, with some additional contributions from the World Resources ...


9

I am not very strong in this area either, but I have modified the Snippets module and have made a couple wrappers for very simple tasks. I have an example of just adding line elements. The example at under the main block forms a triangle to the layout view just outside the document. I use this script in conjunction with another and arcpy search cursors ...


9

I think I know what you mean, you should do that by 2 tools step by step first step find in arctoolbox intersect (Analysis) and then create intersect point layer in Intersection tools window choose "point" in output type field intersect(Analysis) finally [Step2] by Split line at point tools in ArcToolbox you can split polyline based on intersection points ...


8

A file geodatabase has 3 types of locks. SR - schema lock RD - read lock ED - edit lock The proposed solution by @StacyR will work in all situations except for exclusive edit locks (ED) according to arcgis help documentation. http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//003n0000007t000000


8

While Esri does have some freely available tools, the ArcObjects SDK (.NET or Java) is not one of them. ArcObjects is a licensed product, available from the same distribution mechanism as the rest of the ArcGIS platform. In general, the procedure for gaining access to Esri software is: Contact an Esri representative (via web site, US regional office or ...


8

In another, related but slightly different, post I provided an answer that may be of interest for python users trying to wrap their heads around the Esri ArcObjects help docs.. I came from the other side: I already knew ArcObjects long (long long) before I had even heard of python and thanks to posts like these I am able to include some critical ArcObjects ...


8

ArcObjects .Net SDK for ArcGIS 10.2.x requires Visual Studio 2010 or 2012. Visual Studio 2015 isn't supported for 10.2.x See ArcObjects SDK 10.2.x system requirements - Scroll to bottom of page for info on ArcObjects SDK for the Microsoft .NET Framework. Also: ArcObjects for 10.3.x requires VS 2012 or VS 2013 ArcObjects for 10.4.x requires VS 2013 or VS ...


7

The exact number of explicit terms in an IN clause varies by RDBMS. Oracle limits you to 1000 explicit terms, while the SQL-Server doc only mentions "several thousands". The real issue is that an IN clause is not very efficient. If you have more than a few hundred terms, you'd likely get a faster query by loading a temporary table with the values, then ...


7

The method for removing a feature depends on the cursor. If you are using a recycling cursor: pCur = pFeatClass.Search(null,true) do not call delete in any way, shape or form. Calling delete on a recycling cursor removes the buffer so there is nothing to load the next feature into which is why it's getting cranky when you call NextFeature() - you've already ...


6

You can try Feature Vertices To Points tool to extract start and end points of a polyline then apply this tool Station Lines Arc10.0, to generate perpendicular line along these points.


6

It is simple but you must fool a bit. Feed in your lat/lon or lon/lat depending on your WMS version. Use the point as lower-left corner of BBOX and add some little number for getting the upper-right corner. Ask always for WIDTH=2 and HEIGHT=2 and pixel coordinates 1 and 1. All you need to edit ever is the BBOX. Here comes the request as exploded. I added ...


6

Couple things wrong in your loop. First you are calling dataset = datasets.Next(); at top and bottom of the loop. Right there you are skipping some feature classes. If your feature classes are nested in a Feature Dataset then you have to iterate through it also. It's a good idea to call IEnumDataset.Reset() before starting the loop to ensure you are at the ...


6

It is a replacement ArcGIS Pro .NET SDK: The Road Ahead – SDK and API No need for “external” PIAs (primary interop assembly) like with Arcobjects. Simply install ArcGIS Pro. This is the fully fledged 64-bit version that will use more than 4GB of RAM for processing a long drawback of ESRI - welcome to the 21st century Still limited At Final Release: No APIs ...


6

The Esri help can be quite counter-intuitive, you need to know what you're searching for to get the description... The issue here is that the pictureElement doesn't have a geometry property.. see the Help page for picture element: However the IElement, which implements JpegPictureElement, does have a geometry: Explanation of Esri help symbols, they are in ...


6

You should write an ArcMap Addin Extension. In the extension, listen to DocumentOpened event and from there, show your form. Useful Link To create the extension, use Arcgis visual studio template. Then change SetupEvents method like this: private void SetupEvents() { m_docEvents = ArcMap.Document as IDocumentEvents_Event; ...


6

Assuming your project is setup correctly, with all references added and compiles without errors. Using Visual Studio Express 2013, ArcGIS 10.3 and targeting .Net framework 3.5 Also ensure you add ArcObjects Library References to: DataSourcesGDB GeoDatabase Carto Public Sub New() On Error GoTo Trap Dim sPathFGDB As String Dim sFCName As String ...


6

Something like the following should work: GetModule('esriCarto.olb') import comtypes.gen.esriCarto as esriCarto pMapDocument = CreateObject(esriCarto.MapDocument, esriCarto.IMapDocument) pMapDocument.Open(path) #Do stuff pMapDocument.Save()


6

You can use IPointCollection this way: public void IterateVerticesIPointCollection(IPolyline line) { // Cast the polyline to IPointCollection IPointCollection pointColl = (IPointCollection)line; // Iterate the array... for (int i = 0; i < pointColl.PointCount; i++) { IPoint point = pointColl.get_Point(i); // ...and do ...


6

To get the messages in the catch block, the gp variable needs to be accessible outside try. You could also use finally if you want to get the messages regardless of success. IGeoProcessor2 gp = new GeoProcessorClass(); gp.AddToolbox(@"C:\Users\mxxx\Desktop\GIS_Testing\HbtatTesting\HabitatMon.tbx"); IVariantArray parameters = new VarArrayClass(); ...


6

The important difference is the way interop information is stored; either in your assembly, or in an external PIA. Because ArcGIS already provides PIA's, you should always set 'Embed Interop Types' to false for ArcGIS solutions. The following paragraphs are taken from http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//...


5

Looking at the online resources for Esri I couldn't help but notice how ArcObjects doesn't have its share of rich and up to date resources as other ArcGIS technologies. That is the reason I started the IGeometry Youtube channel to discuss ArcObjects, the series, which I called .NET Programming with ArcObjects, has reached its 14th episode so far and a lot ...


5

As John has stated you probably have a lock on your database from the map service. If your feature class is not versioned and the features you are working with are not complex (i.e. they do not participate in a relationship class or a topology), you can do the following safely without interrupting your ArcSDE users: Use ISchemaLock to get an exclusive lock ...


5

ArcGIS Online has a full REST API: http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r300000267000000 It's also worth mentioning, that the ArcGIS Runtime SDK for WPF and upcoming successor ArcGIS Runtime SDK for .NET provide .NET APIs for interacting with ArcGIS Online items (among many other things).


5

This will take multiple steps: Get a cursor from you selection set public static IFeatureCursor GetSelectedFeatures(IFeatureLayer featureLayer) { if (featureLayer == null) return null; IFeatureSelection fSel = (IFeatureSelection)featureLayer; ISelectionSet selSet = (ISelectionSet)fSel.SelectionSet; ICursor cursor = null; selSet....


5

I'm assuming that you're trying to set the IColor as RGBA with the transparency in the colour... that's not how it works, when you create an IColor from RGBA only the RGB is set, the alpha is ignored... see IColor, the options are CMYK, Gray, HLS, HSV, RGB - none of these have Alpha. To get transparency on a layer you need to use the ILayerEffects Interface ...


5

You can check for the EditState on the editor extension.


5

I am going to write this in VB.Net since that is what I know, and hopefully you can figure out the C# way to do it: To find all the layers, use IEnumLayer interface: Dim pEnumLayer As IEnumLayer = My.ArcMap.Document.ActiveView.FocusMap.Layers(Nothing, True) The second argument determines if this drills down into composite layers. To get the layer from ...


5

This is just conjecture, but there is probably some variable-width text measurement logic going on behind the scenes, and the character W was probably chosen because it is one of the widest characters available in variable-width fonts. I agree that it is a bit nonsensical to do it this way.


Only top voted, non community-wiki answers of a minimum length are eligible