Tag Info

Hot answers tagged

3

Try replacing this line: pUnk_line = pFact.Create(CLSID(esriGeometry.Line)) with this: pUnk_line = pFact.Create(CLSID(esriGeometry.Polyline)) In the help on LineElementClass is says right at the bottom: Geometry: LineElement accepts geometry of type esriGeometryPolyline. The Polyline is used as the geometry with which the symbol is drawn.


2

If you want to select features by polygon using ArcObjects, you would typically use a spatial filter, which is very simple to implement. Here's an example in VB.NET, where pPolygon is your polygon object, and pLayer is the layer you wish to select features from: ' create the spatial filter Dim pSpatialFilter As ISpatialFilter = New SpatialFilterClass() ...


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

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

To clarify the comments, the problem is that you have an IApplication object but haven't linked it to ArcMap (initialized the object): Dim topoUiD As UID = New UIDClass topoUiD.Value = "esriEditorExt.TopologyExtension" Dim m_application As IApplication = My.ArcMap.Application ' initialize the object Dim topologyExt As ITopologyExtension = ...


1

According to this example: public void RegisterDataset(IDataset dataset) { IVersionedObject3 versionedObject = (IVersionedObject3)dataset; bool IsRegistered; bool IsMovingEditsToBase; versionedObject.GetVersionRegistrationInfo(out IsRegistered, out IsMovingEditsToBase); if(IsRegistered) { if(IsMovingEditsToBase) { ...


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

ESRI have "improved" their forum site and it's now hard to find any of the archived threads but I did find this code fragment in a thread from 2008. I've done very little in Engine so this may be a red herring? ICommand command = new ControlsZoomToSelectedCommandClass(); command.OnCreate(this.axMapControl1.Object); command.OnClick();


1

I have eventually solved the issue, based on the post by Hornbydd. Thank you! As he suggested, something in my PATH environment variable was causing mixed architecture (32 and 64 bit) DLLs to get loaded. 1) I downloaded and installed ESRI's 64 bit geoprocessing software for ArcGIS 10.1 Service Pack 1. I had read somewhere else that Python uses a service to ...


1

Had a quick search on Google for what R6034 meant and here are some threads, it may not even be anything to do with ArcMap? Thread Reason StackOverflow Q&A And a whole load more...


1

If you take a closer look at the documentation example, you'll notice that they use the IFeatureClass::AddField function IField guidField = new FieldClass(); IFieldEdit guidFieldEdit = (IFieldEdit)guidField; guidFieldEdit.Name_2 = "OldGlobalID"; guidFieldEdit.Type_2 = esriFieldType.esriFieldTypeGUID; guidFieldEdit.DefaultValue_2 = null; ...


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



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