POST
|
Hello, Here is some sample code that shows how to create a Query Layer: IWorkspaceFactory2 workspaceFactory = new SqlWorkspaceFactoryClass(); string connectionString = "dbclient=oracle11g;" + "serverinstance=190.100.100.200/MYMAP;" + "USER=SDE;" + "PASSWORD=SDE"; ISqlWorkspace sqlWorkspace = workspaceFactory.OpenFromString(connectionString, 0) as ISqlWorkspace; IQueryDescription queryDescription = sqlWorkspace.GetQueryDescription("SELECT * FROM SDE.MYTABLE"); ITable table = pSqlWorkspace.OpenQueryClass("TestQueryTable", queryDescription); IFeatureClass featureClass = table as IFeatureClass; featureLayer.FeatureClass = featureClass; axMapControl1.Map.AddLayer(pFeatureLayer as ILayer); This is based on code posted by a user on another forum (https://code.csdn.net/snippets/229166).
... View more
10-08-2018
11:09 AM
|
0
|
0
|
458
|
POST
|
The feature class name can be accessed via the IFeatureClass.AliasName property: http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//0025000002qs000000 The layer's minimum scale may be accessed via the ILayer.MinimumScale property: http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//0012000006z1000000 A good book on ArcObjects development that you might find useful is Beginning ArcGIS for Desktop Development using .NET, by Pouria Amirian (2013).
... View more
08-30-2016
02:26 PM
|
0
|
2
|
967
|
POST
|
Mickey, Yes, that is correct. I do create my own new layer to add to ArcMap. One would definitely need an instance of a new layer object to hold the properties of the incoming feature service data, so there is definitely a need to create that new layer. However, in order to symbolize and display that new layer the exact same way it was being displayed on the server (and I believe this is your question), you would simply not assign a renderer to it. Thus, in the code I provided earlier, all you'd have to do is to comment out the "renderer" part of the code. This should allow the display of the layer in its "original" form. In this case, the original renderer that was used for the feature service layer on the server (the REST endpoint) would automatically be utilized by ArcMap to render the layer.
... View more
08-29-2016
10:34 AM
|
0
|
4
|
967
|
POST
|
If the exact name of the feature class already exists in the target workspace (or in the target feature dataset), the output feature class name will be automatically incremented by 1. This means, there is no way to integrate the output feature class with an existing feature class of the same name -- at least not with this GP tool. The system will automatically create a new output feature class. This is stated on the Help page below: WFS To Feature Class http://desktop.arcgis.com/en/arcmap/latest/tools/conversion-toolbox/wfs-to-feature-class.htm Of course, one call this GP tool using ArcPy or ArcObjects.
... View more
08-26-2016
04:39 PM
|
0
|
1
|
953
|
POST
|
Setting "Embed Interop Types" to "false" in Visual Studio is the correct thing to do, and indeed, some of your errors with regard to some of your assembly references would be resolved after setting that value to false. This is a general rule of thumb when migrating ArcObjects code from an older to a newer version. For a more detailed explanation, please view the MSDN help page on embedded Interop Types. Type Equivalence and Embedded Interop Types https://msdn.microsoft.com/en-us/library/dd997297(v=vs.110).aspx
... View more
08-26-2016
04:25 PM
|
3
|
0
|
838
|
POST
|
The code sample here below shows how to add a feature service to ArcMap using ArcObjects (click on the image below to enlarge the image):
... View more
08-26-2016
04:04 PM
|
0
|
6
|
967
|
POST
|
As the previous respondent stated, you need to have a specific type of license file in order to develop ArcGIS Engine Applications that use Engine Controls such as the AxMapControl, AxTOCControl, and the AxToolbarControl. This license is called the ArcGIS Engine Developer Kit License. To install and authorize this license, you would need to use the ArcGIS Administrator dialog (shown in the below image) In order to obtain such a license, please contact ESRI Customer Service: ESRI Customer Service http://www.esri.com/about-esri/contact After correctly authorizing your Engine software installation, you will need to correctly .. 1. Bind, and 2. License .. your newly created Engine application. See the following walkthrough documentation that shows how to bind and license an Engine application: Building a map viewing application using the ArcGIS Engine controls http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/#/Walkthrough_Building_a_map_viewing_application_using_the_ArcGIS_Engine_controls/000100000243000000/
... View more
08-26-2016
03:28 PM
|
0
|
0
|
853
|
POST
|
Welcome to ArcObjects. There are lots of resources for learning ArcObjects: Samples on Github (ArcObjects .NET) https://github.com/Esri/developer-support/tree/gh-pages/arcobjects-net One of the samples on the Github page above should provide an answer to your question. Help for ArcObjects can be found in the Online Help for ArcObjects located here: ArcObjects Online Help http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/#/Learning_ArcObjects/0001000000p1000000/ More specifically, you will need to go through the documentation under the topic below in order to understand how to navigate the map, and its layers: Interacting with and configuring maps, layers, and graphics http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/#/Interacting_with_and_configuring_maps_layers_and_graphics/000100000m64000000/
... View more
08-26-2016
02:59 PM
|
0
|
2
|
710
|
POST
|
Visual Studio 2010 is supported by ArcGIS 10.0, and ArcGIS 10.1 System Requirements for ArcGIS 10.0 http://help.arcgis.com/en/systemrequirements/index.html#/ArcObjects_SDK_10_System_Requirements/01510000006n000000/ System Requirements for ArcGIS 10.1 http://resources.arcgis.com/en/help/system-requirements/10.1/#/ArcObjects_SDK_10_1/01510000006n000000/ However, there are probably no public links for downloading these older versions of ArcGIS software (trial versions). Please contact ESRI Customer Service for more complete information. ESRI Customer Service http://www.esri.com/about-esri/contact
... View more
08-26-2016
02:26 PM
|
1
|
0
|
1022
|
POST
|
You can call the ArcMap Identify Tool command programmatically by using the following GUID/Class ID {CF605583-AEA3-41D8-9464-DDD1905243D9} esriControls.ControlsMapIdentifyTool See the following list for a list of the ArcMap Command GUIDs: http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/#/ArcMap_commands/00010000029s000000/ See the following code snippet for an example on how to call an ArcMap command programmatically: ArcObjects Help for .NET developershttp://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#/Find_Command_and_Execute_Snippet/0049000000n0000000/
... View more
07-13-2016
06:46 PM
|
0
|
0
|
286
|
POST
|
1. The easiest way to get a reference to features in ArcMap's ActiveView is to use the Add-in framework. Use this framework to create a button, and then use the button's on-click event as the starting point of your code. 2. If the feature class you grab is of type Polyline, you can cast the polyline to an IPointCollection, and then get the points in the collection and add them to an existing (possibly empty) Points feature class. See the code below: using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Geometry;
namespace CreatePointFC_from_Polyline
{
public class CreatePointFC_from_Polyline : ESRI.ArcGIS.Desktop.AddIns.Button
{
public CreatePointFC_from_Polyline()
{
}
protected override void OnClick()
{
IMap map = ArcMap.Document.ActiveView as IMap;
ILayer lineLayer = map.Layer[0];
IFeatureLayer lineFeatureLayer = lineLayer as IFeatureLayer;
IFeatureClass lineFeatureClass = lineFeatureLayer.FeatureClass;
ILayer pointLayer = map.Layer[1];
IFeatureLayer pointFeatureLayer = pointLayer as IFeatureLayer;
IFeatureClass pointFeatureClass = pointFeatureLayer.FeatureClass;
// Get Feature from 1st layer in ArcMap's TOC - check Object ID
IFeature lineFeature = lineFeatureClass.GetFeature(1);
IPolyline polyline = lineFeature.Shape as IPolyline;
IPointCollection pointCollection = polyline as IPointCollection;
for (int i=0; i < pointCollection.PointCount; i++)
{
// Add point to a Points feature class
IPoint point = pointCollection.get_Point(i);
IFeature pointFeature = pointFeatureClass.CreateFeature();
pointFeature.Shape = point;
pointFeature.Store();
}
ArcMap.Document.ActiveView.Refresh();
ArcMap.Application.CurrentTool = null;
}
protected override void OnUpdate()
{
Enabled = ArcMap.Application != null;
}
}
} See the image below for clarity with respect to the various layers used in the code: For more information regarding manipulation of geometries in ArcObjects, please visit the Online Web Help on ArcObjects here: ArcObjects Help http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/ Some useful topics related to ArcMap Add-Ins and the creation of Geometries: Building Addins: http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/#/Building_add_ins_for_ArcGIS_for_Desktop/0001000000w2000000/ Creating Geometries: http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/#/Creating_geometries/000100000m7v000000/
... View more
04-05-2016
12:23 PM
|
0
|
0
|
862
|
POST
|
What kind of object are you trying to add to ArcMap? Could you be a bit more specific? In case you are looking for further Help on ArcObjects, please visit the following Web page: http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/
... View more
04-05-2016
10:37 AM
|
0
|
0
|
160
|
POST
|
Please go through the documentation below: The Multipatch Geometry Type: An ESRI White Papter (December 2008) https://www.esri.com/library/whitepapers/pdfs/multipatch-geometry-type.pdf
... View more
04-05-2016
10:27 AM
|
1
|
0
|
509
|
POST
|
Please follow the instructions on the following Web Page: Create a PYTHONPATH variable http://mattmakesmaps.com/blog/2013/07/10/fixing-arcgis-10-dot-1-python-console-numpy-import-error/
... View more
02-09-2016
11:36 AM
|
0
|
1
|
759
|
POST
|
Please follow the following instructions listed on this Web Page: Creation of PYTHONPATH Environment Variable http://mattmakesmaps.com/blog/2013/07/10/fixing-arcgis-10-dot-1-python-console-numpy-import-error/
... View more
02-09-2016
11:33 AM
|
0
|
1
|
571
|
Title | Kudos | Posted |
---|---|---|
1 | 08-26-2016 02:26 PM | |
1 | 09-29-2015 04:24 PM | |
1 | 11-02-2015 06:25 PM | |
1 | 10-23-2015 12:27 PM | |
1 | 04-13-2015 05:41 PM |
Online Status |
Offline
|
Date Last Visited |
11-30-2023
04:20 AM
|