Tag Info

New answers tagged

1

It is very unlikely that the in memory workspace is implemented in similar fashion to an on-disk one. Instead of having a persistent storage with IWorkspace, IFeatureClass etc mapped to on-disk structures IName.Open creating new ArcObjects that map to them, they will just be implementations in memory. IName.Open could just return a reference to the existing ...


0

The following function will add a field to a feature class: private void AddField(IFeatureClass fClass, string name, string alias, esriFieldType dataType) { IField newField = new FieldClass(); IFieldEdit fieldEdit = (IFieldEdit)newField; fieldEdit.Name_2 = name; fieldEdit.AliasName_2 = alias; fieldEdit.Type_2 = dataType; ...


0

IMap.Layers returns an enumerator over all layers in the map document. This includes group, raster, vector, graphics layers, and non-root layers in the TOC (i.e. it recurses into group layers). If you have any non feature layers in the map document, casting the ILayer to IFeatureLayer will throw an exception. To handle this, either do a dynamic cast and null ...


1

This post might help and here is a getting started section in the official API page on the ESRI support site.


1

Try using IEnumLayer interfase: IEnumLayer pEnumLayer; pEnumLayer = map.Layers; layer = pEnumLayer.Next(); while (layer != null) { flayer = (IFeatureLayer) layer;


0

As I've always understood it as your feature object is local to the GetFirstValue function it should be destroyed and memory released when the code is returned to the calling code. But I have found COM objects don't always behave as expected and in this case I can't see a problem with you explicitly setting it to Nothing. But how about this as an ...


0

You need to clear the WMS Service Group Layer before adding the single WMSMapLayer. wmsMapLayer.Clear(); wmsMapLayer.InsertLayer(newLayer, 0); Note that this will remove all group/map layers from the WMS Service Group Layer, so if you're adding more than one, it might be advisable to not call wmsMapLayer.Clear() in the body of your loop. I haven't tested ...


0

An alternative option for your first question would be to use IProgressDialogFactory Interface for the processing dialog. The link above has a sample code for your reference.


2

I found a work around to this by using Rick Brewster's suggestions. First, I modified Rick's class by adding a constructor public ToolStripEx() : base() { } Then in my dockable window's designer class "MyClass.Designer.cs" I changed the toolstrip's declared type from System.Windows.Forms.ToolStrip to ToolStripEx. Next, in the InitializeComponent() method ...


0

Unfortunately I do not have a 50 reputation yet to comment on posts so I had to post this here. category="" <-- will place your command or tool under the Misc. category under Customize>Commands. I do not know how to fully hide a custom tool like you are wanting to do.


0

ESRI.ArcGIS.Controls.ToolbarControl class is for ArcEngine Application and you shouldn't use it in ArcMap with ArcObject. To Remove a command from a toolbar: You just need the name or UID of the command you want to remove from a toolbar. Suppose you want to delete fullExtent command from the Tools toolbar: var fullExtent = ...


0

You have to initialize the axToolbarControl like below //Add a toolbardef by passing a UID UID uID = new UIDsClass(); uID.Value = "esriControls.ControlsMapNavigationToolbar"; axToolbarControl1.AddToolbarDef(uID,-1,false,0,esriCommandStyles.esriCommandStyleIconOnly); After that you can get the object as IToolbarControl2 and thereby edit the toolbar.


2

The best option is to use a query to get back the corresponding feature: IQueryFilter queryFilter = new QueryFilterClass(); queryFilter.WhereClause = "NAME = '<featureName>'"; using (ComReleaser comReleaser = new ComReleaser()) { ICursor cursor = table.Search(queryFilter, true); comReleaser.ManageLifetime(cursor); IRow row = null; while ((row ...


1

IEnumLayer will build an index for you when you initialize it. It indexes all layers in the order that they appear in the TOC (the top layer will be index 0, the next down will be 1, etc). You can use this index as your key as it will always be unique to the layer. Here's the code to initialize and access in ArcGIS Desktop: ...


0

As stated previously, this defines the width of the drop-down box, as shown here in the ESRI help. This doesn't have to be a 'W'. You can use any repeated character. It does bring up the question of why not just use a numeric value where the number is equivalent to the width value in some predefined units.


2

This is just conjecture, but there is probably some variable-width text measurement logic going on behind the scenes, and the character W was probably chosen because it is one of the widest characters available in variable-width fonts. I agree that it is a bit nonsensical to do it this way.


1

polyline.splitAtDistance doesn't actually split a polyline. All you have to do is cast your IFeature as IFeatureEdit and use the method IFeatureEdit.Split(). This will create two separate features.


4

IQueryFilter is the best option for your problem.You can put your name value in the whereclause of the queryfilter and thereby you can get the desired feature. ESRI.ArcGIS.Geodatabase.IQueryFilter queryFilter = new ESRI.ArcGIS.Geodatabase.QueryFilterClass(); queryFilter.WhereClause = "NAME LIKE 'LIGHT_POLE'; ESRI.ArcGIS.Geodatabase.ICursor cursor = ...


1

That string represent the maximum length of string that you can show on that combo-box.That mean if it shows "WWW" you can add items of maximum 3 character.If you entered otherwise the arc-map split that string by the maximum length and balance will shown as next item.This also mentioned in Add-in _wizard. See image below


0

Turns out that CreateMarkerSymbolFromFile actually works with PNG, despite of the docs saying it only works with BMP and EMF. Didn't work when I tried it at first, but probably due to some other error. Anyway, just use CreateMarkerSymbolFromFile with esriIPictureType.esriIPicturePNG and it works fine.


1

I also had significant 9.3 code that needed to be upgraded. The good news is that, although some conversion is necessary, it's not difficult. Firstly you need to get your hands on Visual Studio 2010 if you don't already have it... the Express version works just fine but make sure you're not breaking some licensing restriction by using that version. Other ...


0

How can the below be replaced to use a variable in place of hard code values filter.WhereClause = featureClass.OIDFieldName + " IN (1,2,3,4,5,6)"; string strFIDS="1,2,3,4,5,6"; Does the below work ? filter.WhereClause = featureClass.OIDFieldName + " IN (strFIDS)";


1

Here are couple of Google searches that explain what it is: http://www.functionx.com/win32/Lesson08.htm http://msdn.microsoft.com/en-us/library/aa979055%28v=vs.71%29.aspx#feedback From what I understand (and could be wrong) its just a number that is used to indicate what the parent window is. So I don't think you can use it to control the visibility of ...


1

The following code zooms to the extent of the polygon in the map then fits the whole page in page layout. This code gets the polygon and rotates it back to the horizontal (approximately 35° in my example) and then zooms to the extent of that rather than the original polygon extent which is much larger if the rectangle is rotated. Public Sub Zoom() Dim ...



Top 50 recent answers are included