Hot answers tagged

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.


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


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; }


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

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


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


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.



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