New answers tagged

0

Yes, it's safe, until you store the row. The values are changed in the IRow object held in memory immediately but if you call the row separately using ITable.GetRow this is a different (but same) row as it's a different object in separate memory space so its values will not change. The example you've given is indeed safe because it's working on the same ...


0

Point on point isn't going to work, even if the coordinates are exact match, it's a 50/50 whether the feature class point will be selected by the query point. To overcome this I always buffer the point by a very small amount - this depends on your spatial reference, 1 metre (or foot) usually isn't very much but 1 degree usually is a very large number, you'll ...


0

This is a good case for a global variable: namespace lecture5test { public class Button1 : ESRI.ArcGIS.Desktop.AddIns.Button { private int ClickCount = 0; // global to keep track of clicks public Button1() { then in your OnClick event: protected override void OnClick() { ClickCount ++; // go to next click colour ...


1

Thanks to Hornbydd for the accepted answer. Below is the solution in C# in case it helps anyone. The method call to get to the label engine properties is slightly different than vba. IGeoFeatureLayer geoFeatureLayer = (IGeoFeatureLayer)featureLayer; geoFeatureLayer.DisplayAnnotation = true; IAnnotateLayerPropertiesCollection propertiesColl = ...


1

Red -> Blue -> Green -> Red etc. Just wrap your pPage.BackgroundColor = in if/else if/else something like if (pPage.BackgroundColor.RGB == ic.RGB) { pPage.BackgroundColor = ib; } else if (pPage.BackgroundColor.RGB == ib.RGB) { pPage.BackgroundColor = ig; } else { pPage.BackgroundColor = ic; }


2

The following VBA code demonstrates how to turn that property on: Public Sub test() ' Get document Dim pMXDocument As IMxDocument Set pMXDocument = ThisDocument ' Get map Dim pMap As IMap Set pMap = pMXDocument.FocusMap ' Get first layer, assumed this is what you want to label Dim pLayer As ILayer Set pLayer = ...


0

An extension to Nmktronas' answer: At least with Shapefiles, features hold a lock on the feature class they're from, so it is necessary to release them in order to e.g. delete the workspace (at least using System.IO.Directory.Delete for a Shapefile folder). This is true even with a recycling cursor that has been fully iterated - the recycled feature must be ...


0

I contacted ESRI UK about developing with ArcObjects on the Home Use licence, and they stated that they do not allow it and that an EDN licence should be purchased for development purposes. The Home Use downloads also do not include the .NET SDK, reinforcing this statement. ESRI themselves, of course, may have a different view, so it's still worth contacting ...


0

According to my opinion you are mixing something up. If you are writing some code to use inside a running ArcMap process you have to work with the IMxDocument. In a standalone application without ArcMap only using arcobjects you have to work with the IMapDocument to access an MXD. Using both at once does not work correctly. If you like to access the style ...


1

Problem Solved pMap is Input arg MainMap and axMapControl1.ActiveView.FocusMap is Input arg ChildMap IObjectCopy esriObjectCopy = new ObjectCopyClass(); System.Object copyTarget = axMapControl1.ActiveView.FocusMap; System.Object copySource = pMap; esriObjectCopy.Overwrite(copySource , ref copyTarget); IBasicMap basicMap = ...


1

I ended with the same result months before and I could not found a solution using IPrintAndExport. I would recommend to use theIExportdirectly. Please have a look at the following ExportActiveView function in this example in VBA or this post to a different topic with an example in C#. This works without problems in my case. You can simply exchange the ...


0

Use method bootstrapArcobjectsJar described in: http://help.arcgis.com/EN/sdk/10.0/Java_AO_ADF/ConceptualHelp/engine/index.html#//0001000003n1000000 In export options for runnable jar file select 'copy required libraries into subfolder ...' Then you should be able to run your app without generated subfolder. Bootstrap method will find and add arcobjects to ...


0

Have you tried using this pattern: Dim windowID = New UIDClass() windowID.Value = My.ThisAddIn.IDs.DockableWindow1 Dim dockableWindow As IDockableWindow = My.ArcMap.DockableWindowManager.GetDockableWindow(windowID) Where 'DockableWindow1' is the name of your dockable window in the Config.esriaddinx file.


3

As I recall, you need to listen to IDocumentEvents. When OpenDocument fires cast the IMxDocument to IDocumentDatasets. For each IDatasetLayer2 in IDocumentDatasets.Datasets: Cast IDatasetLayer2.DataSourceName to IDataSetName. Get (by value) IDatasetName.WorkspaceName. Get (by value) the propertyset from IWorkspaceName.ConnectionProperties. Change ...


2

Extending on Chad's answer, following does the trick for feature layer with multiple legend groups for (int k = 0; k <= (featureLayer as ILegendInfo).LegendGroupCount - 1; k++) { (featureLayer as ILegendInfo).get_LegendGroup(k).Visible = false; }


2

Looks like IDataStatistics.UniqueValues returns a System.Collections.IEnumerator Frankly, I've found it easier to just use a search cursor and populate a Generic Dictionary than to deal with IDataStatistics.


0

I was incorrect in saying that no suggestion in THIS post worked. Over the last decade I learned to always seriously consider anything mr. @Kirk Kuykendall posts with extra attention. The credit for this answer should go to him but since the OP didn't mark the original question as answered I will do it here and if Kirk can just copy his comment here and make ...


1

So it turns out that to use an Identity Tool you need to pass it the string of the location for the FeatureClass. This was somewhat confusing as the parameters state that it must be an Object. Identity ident = new Identity(); ident.in_features = inputFeatureClassLocation;//String ident.identity_features = ...


0

In Oracle geodatabases, the DEFINITION column is an ArcSDE XML type rather than the native Oracle XML type which stores the information as BLOBs. To enable reading these values, the SDE schema in Oracle contains a view for the GDB_Items table named GDB_Items_vw for details http://support.esri.com/ES/knowledgebase/techarticles/detail/38375


0

Try this ELSE statement: else: print("Adding new Label Engine")# TODO Remove, for debugging # New Label Engine pLabelEngineProp = Snippets.NewObj(carto.MaplexLabelEngineLayerProperties, carto.ILabelEngineLayerProperties2) # Apply Symbol pLabelEngineProp.Symbol = pLabelStyle.Symbol # Apply Placement Properties ...


1

Try ICurve.QueryPoint with asRatio = true, and distanceAlongCurve = 0.5: Copies to outPoint the properties of a point on the curve at a specified distance from the beginning of the curve.



Top 50 recent answers are included