ArcObjects is a set of COM-based APIs from ESRI Inc. that are used in several of their products including ArcGIS Desktop, ArcGIS Engine and ArcGIS Server.

learn more… | top users | synonyms (3)

4
votes
2answers
463 views

ArcObjects: How to measure the draw time of a layer in ArcMap?

I'd like to quantitatively measure the display performance of mosaic datasets, image service layers, raster layers, feature layers, etc. in ArcMap 10. How can I measure the draw time of a particular ...
4
votes
4answers
2k views

Determine overlapping points using a spatial filter in ArcObject

I have a point layer with thousands of points. Using a spatial filter, I have to find out those points which are intersecting each other. Then the objectid's of the intersecting points should be ...
4
votes
4answers
3k views

Sum the values of a single raster and output the value as a number?

I have a floating point raster and have applied a conditional to it in order to only extract the positive values, so there are 'no data' "holes" in the raster. I simply need to sum the values from ...
4
votes
2answers
241 views

How do you determine if feature is editable?

I am using the FocusMap.FeatureSelection to return all the currently selected features. I want to process only the currently editable features and leave the remainder alone. How can I quickly ...
4
votes
2answers
866 views

Comparing two featureclasses using C#

I'm sorry, I know this is a pretty simple question but am having trouble getting this to work. Basically, I have 2 linear featureclasses and they both have the same fields and spatial reference. FC1 ...
4
votes
3answers
2k views

Delete a feature data set in SDE 10 programmatically

Is there a way to delete a feature data set and all of its feature classes programmatically either by using custom code or pre-existing command line tools? There is a tool provided by SDE called ...
4
votes
2answers
1k views

Programmatically alter AliasName for fields defined in layer file (not underlying source)

Is there a way to alter the AliasName on a layer file only, and not the underlying shapefile or feature class? I have a few hundred layers that define joins between hundreds of tables with census data ...
4
votes
2answers
195 views

Maximum length of WHERE clause with IN statement

I need to get all features from feature class where their field value matches to input array. To achive this one may set IQueryFilter.WhereClause property similar to 'FIELD_NAME IN (array[0], ...
4
votes
2answers
544 views

Is IPolygon2.QueryExteriorRingsEx Method not working in ArcGIS version 10.1 SP1?

I am updating my addins from 10.0 to 10.1 and my code is crashing on the IPolygon2.QueryExteriorRingsEx Method. I understand there is something strange going on with this method because Developer ...
4
votes
2answers
2k views

How do I change the targeted .NET 4.0 Framework to version 3.5 in an existing VS 2010 EXPRESS project?

I am upgrading from ArcGIS desktop 10.0 to 10.1 and I have a bunch of addins developed in VS 2008 Express using ArcObjects 10.0. I would like to upgrade everything to 10.1 using VS 2010 Express. I ...
4
votes
2answers
526 views

How to select features that intersect but don't touch (using ArcObjects)?

So how do I do that? ArcMap's Select By Location selects also all features that touch, but I only need the ones that actually intersect the area. I currently use ...
4
votes
1answer
401 views

Programatically take screenshot of map extent in ArcMap 9.3

Is it possible to programatically capture a screenshot of the current map extent (the map area with any active displayed layers) in ArcMap with the ArcObjects .NET SDK?
4
votes
1answer
105 views

Is it possible to access the Catalog window programmatically in ArcMap?

Specifically, I would like to get the selected object, similar to the way you do in ArcCatalog through IGxDialog.SelectedObject. Is there a way to do this? So far I can get the Catalog ...
4
votes
2answers
871 views

Running ArcPy script from ArcObjects?

the standard method requires to run ArcPy script in command line, i've struggled with it to run but without a result, i can import arcpy, set the workspace to the geodatabase path and describe the env ...
4
votes
4answers
462 views

How to get exact ISymbol image size in pixels

I found the next code to convert ISymbol into bitmap image, but how to know the suitable image size? (suppose we have a ITextSymbol) private static Image PointSymbolToImage(ISymbol symbol, Size ...
4
votes
1answer
855 views

ArcObjects - Create a map in the background from layers and save as JPG

Given a series of map layers is it possible to arrange them in some order, add basic map features (north arrow, scale bar) and then save the result as a JPG. I'd like to accomplish this in the ...
4
votes
2answers
1k views

Adding data from a SQL Server Spatial database to ArcMap or ArcEngine application with ArcObjects for better performance

I have an ArcSDE geodatabase stored in MS SQL Server 2008 R2. The datasets in this geodatabase range from 10 record to 7 million records and there is a mixture of tables and spatial datasets (SQL ...
4
votes
1answer
1k views

How to run VB scripts in ArcGIS?

Some questions about VB scipts: Can I read and modify the code of a VB script? If the answer is yes, how can I do it? How can I run a VB script? Can I use it as a VBA code eg.using variables instead ...
4
votes
1answer
746 views

Edit SDE table with ArcObjects

The link below provides a code snippet for editing an SDE table with ArcObjects. Are there any other or newer code examples out there of how to edit a SDE table by using ArcObjects? Edit SDE ...
4
votes
2answers
1k views

Problem creating a point IFeatureClass

I'm trying to create a point IFeatureClass, but my code doesn't work. Public Function CreatePointFeatureClass(ByVal featureClassName As String, _ ByVal ...
4
votes
2answers
1k views

Get Database Table Name From Layer Name in ArcObjects

I am using ArcObjects v10.0 with a SQL Server 2008 database. Given the name of a Layer, is there a way for me to extract the corresponding name of the database table that represents that Layer? The ...
4
votes
5answers
592 views

Intersection of two lines tool

Is there any way to make intersection of two lines tool with extending lines option, so the result would be a point. the hardest part is when the lines have to be extended to intersect. the tool will ...
4
votes
2answers
795 views

A bug in ESRI Line Geometry WKB that adds needless, trailing 0's behind otherwise valid WKB?

[Update 7.13.2012] My coworker noticed the the ESRI Line WKB is malformed contains unspecified trailing data, and since he's not active on GIS.SE, I posted his remarks as an answer. I'll wait a few ...
4
votes
2answers
1k views

Perform a spatial join in C# with ArcObjects

I feel like this has to be on the internet somewhere, but I haven't been able to find it. I'm attempting to perform a spatial join on a polygon and point layer. My goal is to push the polygon's ID ...
4
votes
1answer
515 views

ArcObjects joins and non-persistent fields after joining to multiple tables

I have inherited a truly awful and very large ArcObjects project that was originally written in VB and then ported to C#. Apparently the source code I have been given is not the latest version and I ...
4
votes
2answers
4k views

ArcObjects - Finding the intersection of a polyline and polygon?

I have a polyline and polygon. The polyline will intersect the polygon at two or fewer points. I would like to get these intersection points as X and Y values. EDIT: Here is a quick code sample using ...
4
votes
2answers
887 views

MapScale not being persisted properly in mxd when programmatically changed outside of ArcMap environment

I am trying to change the scale of a map in an mxd OUTSIDE of ArcMap in a standalone Windows application. The problem is the scale is never persisted - the best code I have come up with is the ...
4
votes
1answer
2k views

How can I import layer symbology from another layer programmaticaly with ArcObjects & VBA?

I would like to be able to develop a procedure that runs through all layers in the TOC and if the layer (name) exists in a specific folder where I am storing layer files with complex symbology I would ...
4
votes
3answers
5k views

How do I upload a Featureclass to a Geodatabase in C#?

All, I have a featureclass with Arcobjects that came from a Shape file and I wish to import it into a geodatabase. I have the geodatabase connection, I just don't know how to load the feature class ...
4
votes
3answers
54 views

ArcObjects : How to identify ITool.OnMouseUp method execution

In ArcMap, I have a tool that inherits BaseCommand. The tool enables the user to draw a graphic on the screen. I activated this tool (set as current tool) from a Windows UserForm by getting its ...
4
votes
2answers
134 views

Common variable naming convention in ArcObjects

Not sure if this is really that important, but I'm wondering if there is a list of "common variable names" for different ArcMap objects... for instance, sometimes you see: IMxDocument mxdoc = ...
4
votes
1answer
453 views

How to set focus on ArcMap map window using arcobjects and c#.net

I have developed a custom dockable window with textboxes, comboboxes and a button for use in ArcMap. After the user clicks on the button in the dockable window a function is invoked. After the ...
4
votes
1answer
96 views

How to detect densely labelled areas?

I'm trying to detect densely labelled areas for a given scale like explained below. so dense labelled area is the area having high rate of overlapping labels. I'd like to detect densely labelled ...
4
votes
1answer
426 views

How to programmatically clear all layers from data frame?

I'm trying to create a button using VB.NET and ArcGIS 10 to clear the layers of my data frame. I know how to add layers, but I don't have any idea on how to delete/clear them. Any suggestions? ...
4
votes
1answer
2k views

How to make a WPF Window be a well-behaved child window of ArcMap?

I am pretty familiar with Windows Forms in ArcGIS but WPF, which I'm just starting to tinker with, seems to be a different animal. I've created an ArcMap add-in with a button that displays a Window ...
4
votes
3answers
720 views

ArcServer 10.1 - Publishing C# Executable as a Geoprocessing Service

I am trying to publish an arcobjects C# executable as a gpservice. We did this in 10.0 by adding it to a toolbox and hitting publish. Using ArcCatalog in 10.1 you must first run the script before you ...
4
votes
3answers
354 views

How to use ITrackCancel to escape IRubberBand track?

I have a BaseTool for AX_MapControl and AX_PageLayoutControl that allows to draw a polyline via IRubberBand. But once the rubberband is started, you can't cancel it e.g. by hitting escape. I found ...
4
votes
1answer
447 views

How to find the service pack level in ArcGIS Addin?

I can query the current version from RuntimeInfo.Version. But I would also like to know what service pack is also installed. Do I need to just check the registery key ...
4
votes
1answer
485 views

Can you edit an SDE table via ArcObjects when not added to ArcMap

I have a table that is in SDE, what I want to do is in my userform click on the "Save" button, and the table will be edited even though it is not within the map document. Is this possible? I have ...
4
votes
2answers
352 views

How to enable MapTips in ArcGIS Engine? (ArcGIS 10)

My organization is working on a new version of our software using ArcGIS Engine. Previous versions of the software (running on ArcGIS Engine 9.3) displayed MapTips fine as long as they were enabled in ...
4
votes
1answer
590 views

Has anyone found a workaround the IMemoryBlobStream.LoadFromFile() error

As far as I am aware, you will get an error if you try to load large file sizes using the function IMemoryBlobStream.LoadFromFile(). Has anyone found some workaround code to load a file into a ...
4
votes
1answer
313 views

Directory.GetFiles vs. ListDatasets - Which is the tool for the job?

I'm currently writing an arcobjects app that performs an arbitrary set of geoprocessing tasks on a group of shapefiles and/or dbf tables. My current implementation uses Directory.GetFiles to build an ...
4
votes
3answers
152 views

How do you navigate the ArcObjects OMDS?

How does everyone get round navigating the different OMD's I can work with single interfaces no problem, but when i have to use multiple interfaces I struggle to get my head round go through different ...
4
votes
3answers
476 views

“ZoomToLayer” not working

I am trying to call ZoomToLayer from my custom code (shown below). ESRI.ArcGIS.esriSystem.UID pUID = new ESRI.ArcGIS.esriSystem.UID(); ICommandItem CmdItem; //pUID.Value = ...
4
votes
1answer
767 views

Checkout Spatial Analyst extention, ArcObjects code

Update After investigating more closely the CODE 2 sample below (at the end of this post), it does check out spatial analyst (sa) extension, however it does not reflect it in the Tools>Extensions ...
4
votes
2answers
5k views

How to implement mouse down event when the user clicks on the map?

Newbie programming in C#.net. I have a very simple desktop application in in arcmap. I'm trying to get the coordinates when a user clicks a button on a toolbar and when click the map. The toolbar is ...
4
votes
1answer
777 views

How to catch when layers visibility change in ArcGIS?

I'm trying to regenerate a Legend in a Pagelayout whenever the layers visibility are changed in the TocControl. What is the best way to catch when a layer visibility is changed?
4
votes
2answers
236 views

Is the order in which ArcMap loads Extensions, Toolbars and Commands defined?

When you extend Esri's ArcMap with both an Extension, a Toolbar and a number of Commands, is the order in which these categories are loaded by ArcMap well-defined? (I.e. are Commands always loaded ...
4
votes
1answer
102 views

Cannot use a SnapAgent alone?

I'm trying to use a standalone snap agent. Is that not possible? Here's some code: // instantiate these agents. _snapSupportAgent = new FeatureSnapClass(); ...
4
votes
1answer
682 views

How to declare ArcSDE workspace for Geoprocessing tool in ArcGIS 10.1 using ArcObjects and c#?

What is the proper way to declare an ArcSDE workspace for Geoprocessing tools in c# .net? I am using ArcGIS 10.1 SDE (MS SQL) on SQL Server 2008. I want to write code so that every night the server ...