arcobjects

How do I add point features from memory rather than a database or file?

I am embedding the MapControl into a C++ application. The application is tied to a proprietary, non-relational database. Therefore, linking the map control directly to GIS data is not feasible. Instead, I want to simply load my own point features into a Feature layer. I understand the mechanics of creating a Feature layer, but they appea...

Using COM and querying objects that are still "alive"

Hello guys. I work alot with ArcObjects, ESRI's API to program for ArcGIS applications. I would like to know if there is a tool where I can inspect what COM objects are alive or are on stack. I already know to free them, but I would to inspect each method to see if there are any leftovers. ...

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

All, I have a featureclass with Arcobjects 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 to a proper table in the geodatabase. Im looking for a code example seeing I can't find it by googling. Hopefully in C#, but I don't mind reading through VB if neede...

How do I release an InMemoryWorkspaceFactory in the ESRI Map Control?

I am embedding the ESRI Map Control into a custom ActiveX control written in MFC/C++. The custom ActiveX control serves as a Map Control wrapper so I can embed it into a specific environment that is runtime only and non-relational. Thanks to this site, I am able to load feature points into an in-memory workspace. However, the hosting env...

Why is my code not using available processor cycles?

I have written a plugin for ESRI ArcEditor that runs some validation checks on a road network. To check if the rules are all satisfied, it basically does a whole bunch of different intersects, with some buffering and envelopes etc. on the selected features. It has been written in C#. Now what I am noticing is that it really takes a lon...

Converting Lat / long to PointClass

IPoint pPoint = new ESRI.ArcGIS.Geometry.PointClass(); pPoint.PutCoords(-92.96000, 44.9227); //This should be near Minneapolis mapControl.CenterAt(pPoint); //mapControl is a AxMapControl When I run this code the point always ends up near Kansas. Can anyone help me convert lat / longs to an PointClass that will work properly? I'm using...

Open DBF Table -> create layer ESRI arcobjects

I have successfully opened a DBF Table: String dbfDirectoryPath = "Z:/ESRI/data/washingtonCountyDataFiles/tlg_roads"; IWorkspaceFactory workspaceFactory = new ShapefileWorkspaceFactory(); IWorkspace workspace = workspaceFactory.OpenFromFile(dbfDirectoryPath, 0); IFeatureWorkspace featureWorkspace = workspace as IFeatureWorkspace; Strin...

How to access sublayer of a basemap in arcobjects?

ILayer layer = mapControl.get_Layer(1); //layer 1 is usa_base_map I have an ILayer, now I want to access and turn on and off various sublayers like the street layer or the railroad layer. Can you tell me how to access these layers? ...

How to clear an ILayer?

I can clear all the layers using mapControl.ClearLayers(), but I only want to clear one layer (a sublayer of a basemap, like cities). I'm new at this, thanks in advance. edit: i am using C# ...

GraphicTracker what to use for IGeometry? ArcObjects

IGraphicTrackerSymbol myPointSymbol = graphicTracker.CreateSymbolFromPath("Z:/ESRI/sprites/car.jpg", ""); graphicTracker.Add(null /* what to put here for IGeometry?? */, myPointSymbol); Where can I get the IGeometry of my sprite? ...

How can I create an IDynamicDisplay obj in ArcObjects?

I am trying to draw a text glyph on the map and all the tutorials say I need a IDynamicDisplay, but I don't know how to get at one. Thanks in advance. ; ) edit: C# VS2010 ...

arcobjects can't draw dynamic draw screen objects

I enabled the map to allow dynamic objects Then I grab the IDynamicDisplay from an event which I wired up. void dynamicMapEvents_AfterDynamicDraw(esriDynamicMapDrawPhase DynamicMapDrawPhase, IDisplay Display, IDynamicDisplay dynamicDisplay) { if (DynamicMapDrawPhase != esriDynamicMapDrawPhase.esriDMDPDynamicLayers) return; IDynamicDr...

How to display text on top of a dialog bubble in arcobjects?

I am rendering a text glyph with DrawCompoundMarker and I am drawing the dialog bubble with a graphicTracker.Add call, but the text is getting displaced instead of rendering on top of the dialog bubble. How can I make the text render on top of the dialog bubble? ...

ESRI - Arcmap help to create a button that will populate current date for selected features

I would like to create a custom tool or button in Arcmap that programmatically fills in a number of attributes of selected features for a layer. To keep things simple, lets say my Arcmap project only has one SDE layer, and I'd like to populate the Date_Created field. The SDE layer being edited is versioned. I have some code that partial...

Can custom map tiles be consumed via ArcObjects within my ArcGIS 10 Desktop AddIn?

Can I programmatically consume and render custom map tiles in ArcMap via our ArcGIS 10 Desktop AddIn? The AddIn is built using the ArcObjects SDK for C#/.NET and ArcGIS 10. Pulling and rendering map tiles is NOT the AddIn's primary function. But we would definitely like to implement this feature if it can be done. More specifics: ...

How do I limit the SelectByShape method to a single layer?

In ArcObjects, the IMapControl interface's SelectByShape does very nearly what I want it to do. That is, it selects all the features within the given shape. However, like ArcMap, I'd like to be able to set an "active" layer such that, when using SelectByShape (or some other equivalent), it selects only features in the currently active la...

Python, ArcObjects, and .AppRef: how to get from IAppROT to IMxDocument?

I am writing an external Python/comtypes script (in PythonWin) that needs to get a reference to the current ArcGIS 10.0 ArcMap session (through the ArcObjects COM). Because the script is outside the application boundary, I am getting the application reference through the AppROT (running object table). The first code snippet below is the...