Tag Info

Hot answers tagged

5

As John has stated you probably have a lock on your database from the map service. If your feature class is not versioned and the features you are working with are not complex (i.e. they do not participate in a relationship class or a topology), you can do the following safely without interrupting your ArcSDE users: Use ISchemaLock to get an exclusive lock ...


3

I've never tried this, but from the documentation it doesn't appear possible to change a layer's label positioning properties using arcpy. The layer class provides access to that layers' labelClass - but from what I can see, this only gives the option to toggle labels on/off, change the expression, and set SQL queries. It doesn't appear to give access to ...


3

The method for removing a feature depends on the cursor. If you are using a recycling cursor: pCur = pFeatClass.Search(null,true) do not call delete in any way, shape or form. Calling delete on a recycling cursor removes the buffer so there is nothing to load the next feature into which is why it's getting cranky when you call NextFeature() - you've already ...


3

You will need to use ArcObjects. You are looking for the IDisplayExpressionProperties interface. It is obtained from IDisplayString, which in turn is obtained from IFeatureLayer. Here you will find a fantastic little snippet of code provided by patrick that does the trick: public void annotateLayer(ILayer thisLayer, String geocode, double minScale, double ...


2

If you comment out the Store call, you should be good: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//0025000007wv000000 Store should not be called inside of edit events, such as OnCreateFeature, OnChangeFeature or OnDeleteFeature. Even if you are modifying the geometry or other field values, Store will be called once the ...


2

ArcGIS Online has a full REST API: http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r300000267000000 It's also worth mentioning, that the ArcGIS Runtime SDK for WPF and upcoming successor ArcGIS Runtime SDK for .NET provide .NET APIs for interacting with ArcGIS Online items (among many other things).


2

You need to access the active document in order to get access to layers. Create a reference to the document using your IMxApplication object (pMxApp): Dim pMxDoc as IMxDocument = pMxApp.Document Then access layers through focusmap: Dim pLayer as ILayer = pMxDoc.FocusMap.Layer(i) Where "i" is the index of your layer.


2

You can use Trace Geometric Network gp tool and accumulate in_edge_along_digitized_weight {An edge weight that is used as a cost for traversing through an edge along the digitized direction of that edge. The weight must already be defined for the given geometric network} - and - FIND_UPSTREAM_ACCUMULATION. use the accumulated value for the index


2

If you have an IPointCollection you can add points to it (IPoint), be careful which point you use as there are many types that are "point", the one you want is IPoint: IPoint pPoint = new PointClass(); // in C# Dim pPoint as IPoint = new PointClass() ' in VB.net Then add to the IPointCollection, assuming known X,Y and Z: Dim pPntColl as IPointCollection ...


2

See this question: Event raised when selected layer changes in TOC, but it will unfortunately not be good news for you, as no event of such kind is available in ArcObjects. The answers will provide some hack-ish workarounds which you may find useful.


1

That should work without problems, double check if the parameters that you are passing to the IPropertySet object are right. Are you writing the "serverinstance" property properly? that's the most common problem. IPropertySet propertySet = new PropertySetClass(); propertySet.SetProperty("dbclient", "SQLServer"); ...


1

iTopologyExtension interface is part of the ESRI.ArcGIS.EditorExt namespace, so you need to import this namespace at the top of your module (and also check it is added to references): Import ESRI.ArcGIS.EditorExt Or if you don't want to import, just reference iTopologyExtension in full: Dim pTopoExt As ESRI.ArcGIS.EditorExt.ITopologyExtension I think ...


1

include ESRI.ArcGIS.DatabaseSourcesFile in your project here is a C# code showes you how to open a shape file,you can convert it to VB.Net simply IWorkspaceFactory ipShapeWF = new ShapefileWorkspaceFactoryClass(); `//strfilepath the path to shape file,include only folder not shape file itself' IWorkspace ipShapeWS = ipShapeWF.OpenFromFile(strfilepath, 0); ...


1

Just an idea but you seem to be constructing your rectangle from a ring and the help talks about wrapping rings in higher level geometry. If it were me and as it looks like you are building a simple rectangle I would have built the polygon this way (not sure it makes a difference but worth a try?)... Dim pPolygon As IPolygon4 Set pPolygon = New Polygon Dim ...


1

I have never tried them myself, but it looks like the iScreenDisplay interface has rotation functions: iScreenDisplay Also check out screenDisplay.DisplayTransformation.Rotation() Might be a good starting point.


1

You'll need to define both a horizontal coordinate system (could be projected, like UTM) and a vertical coordinate system (like NAVD88, making sure to be in the same units as your horizontal). A vertical coordinate system expresses elevations relative to a baseline, usually a mathematical representation of the Earth's surface. Your measured elevations ...


1

try this using ESRI.ArcGIS.DataManagementTools; FeatureToPolygon featureToPolygon = new FeatureToPolygon(); featureToPolygon.in_features = pInWorkspace.PathName + "\\" + pInFeatureClassName.FeatureDatasetName.Name + "\\Temp_Line_UnNamed"; featureToPolygon.out_feature_class = pInWorkspace.PathName + "\\" + pInFeatureClassName.FeatureDatasetName.Name + ...


1

It could just be my perspective as an ArcGIS jockey, but handling the feature relationships in your own code sounds harder. If you take advantage of ArcGIS's ability to do that, I think it's simpler. How do you feel about spending some of your 8 weeks learning ArcGIS and Python? :) I don't know if there is a better way to traverse a network, but you can at ...


1

Assuming you're creating an ArcMap Add-in: Dim pApp as IMXapplication = CType(My.ArcMap.Application, ESRI.ArcGIS.ArcMapUI.IMxApplication) Dim pDoc As IMxDocument = pApp.Document Dim pMap as IMap = pDoc.FocusMap ' document may contain many maps, this is the acive one' Dim pSR as ISpatialReference = pMap.SpatialReference This is the chain from ...


1

As Hornbydd said you want to use the IProximityOperator3d interface. In order to find a distance from the Earths' surface you need to get a good model of the Earth, after that it's just a return distance. There are different operators depending on how this is modeled: DEM, TIN, Terrain... when you've got that model post that as a separate question as the ...


1

Full Code. Basically the code loops through polygons, selects the exterior ring, copies the OID of a line feature class to a list that intersects the exterior rings. then loops through a line feature class looking for feature codes then based on the feature code that has the longest accumulated segment length, puts the feature code attribute into the ...


1

The parameter for passing a polygon needs two other ESRI fields populated in the parameter list. If the fields are not present (even if they have no meaningful value) then the ESRI service will return a FAIL result without any logs or exceptions. for (int fieldIndex = 0; fieldIndex < fieldArray.FieldArray.Count(); fieldIndex++) { if ...



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