Tag Info

New answers tagged

1

Cast them to ints, add them and recast back to esriSnappingType, like: snappingEnvironment.SnappingType = (esriSnappingType) ((int)esriSnappingType.esriSnappingTypePoint + (int)esriSnappingType.esriSnappingTypeEndpoint + (int)esriSnappingType.esriSnappingTypeVertex + (int)esriSnappingType.esriSnappingTypeEdge);


1

Not sure by your question if you want the map spatial reference or a layer. For a map you may use the IMap.SpatialReference Property.


5

Assuming you have a reference to the feature class pFC: ERSI.ArcGIS.Geometry.ISpatialReference pSP = ((ESRI.ArcGIS.GeoDatabase.IGeoDataset)pFC).SpatialReference; coord=pSP.FactoryCode coord now contains the code for the coordinate system. Note that not all projected coordinate systems are defined in esriSRProjCSType, there are more constants ...


1

You would do something like this: dataset = "c:/data/landbase.gdb/Wetlands" spatial_ref = arcpy.Describe(dataset).spatialReference as per the ESRI help page here


0

I realize this is quite a while after the question, but we just 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 metadata" - documentation is still to come, but we tried to keep things relatively ...


0

First of all you can't just assign null to _SelectMyElement and then use it. It will cause an exception later. Second pGraphicsCont does not implement ITextElement. You should uncomment your assignment of _SelectMyElement and select _textElement. You also might need to refresh the display. if (item.Caption == ...


1

Your code looked ok to me. I did simplify it a bit so I could run it to as an add-in Button and it worked fine in 10.2.2. You will be able to run this on two layers, The first layer in the Map will need to have a field called ID, and the Second layer needs a feature with OID 5 as written. What line is the code failing on? public class Button1 : ...


0

When using newtonsoft.json assembly, you can make a request to ArcGIS Online passing credentials. Below is my sample C# class that accesses this information from ArcGIS Online. More in-depth knowledge of the REST API as mentioned above would be helpful for any .NET developer. using System; using System.Collections.Generic; using System.Linq; using ...


1

You can't cross thread boundaries with COM objects, I'm guessing that's your issue. Read this help topic for some strategies to get around this.


1

I found the solution thaks to : ArcObjects: Memory leak in IFeatureClass.Search (only on SDE with direct connect) Code correction : ITopologicalOperator4 topoOperateur = ((IClone)secteurPsr.Shape).Clone() as ITopologicalOperator4; IGeometry geomPsr = ((IClone)currentPsr.Value.Shape).Clone(); IPolyline polylinePsr = geomPsr ...


4

To select from the map using the current selection environment (you can turn off selectability and visibility of layers then this wont pick them up. Firstly you need to be creating a tool: using ESRI.ArcGIS.Carto; using ESRI.ArcGIS.ArcMapUI; using ESRI.ArcGIS.Geometry; using ESRI.ArcGIS.Framework; using ESRI.ArcGIS.esriSystem; using ESRI.ArcGIS.Display; ...


0

Edit: completely rewrote answer since i cut and pasted together c# and VB.NET code by mistake. This is how a onCreate typically looks like: public override void OnCreate(object hook) { if (hook == null) return; m_application = hook as IApplication; if (m_application == null) return; UID uID = new UID(); ...


2

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 ...



Top 50 recent answers are included