Program in arcgis using the net framework and c




















See the links in the Related Information section below for further reference. How can we make this better? Please provide as much detail as possible. Contact our Support Team. Request Case Start Chat. Translation Feedback How can we make this translation better? Get notified about latest updates to this technical article? Yes No. Do you want to Unsubscribe? Questions or issues with the site?

Send Feedback. Please rate your online support experience with Esri's Support website. NET applications are fast and efficient. Before you proceed, you need to open the listing files in the exercise archive downloaded so you can refer to them. Next, verify that you have the Microsoft. NET Framework installed. To find out if you have. NET Framework version 2. If you have a v2. NET Framework 2. NET and C languages.

To follow along with the examples in this article, download and install Visual C Express Edition. Installing Visual Studio any licensing level will also install the. NET Framework. NET 2. This will allow you to run the C command line compiler from any directory with ease. Make sure you get the version correct, and don't forget the semicolon in the front to separate it from the previous environmental variable in the PATH list.

For the purposes of this article, all code listings will be in C. There are a number of ways to write and compile. NET applications. Writing your code in Notepad and compiling using the C command line compiler is by far the simplest way of constructing a. NET application. Start Notepad or your plain text editor of choice and type the code from Listing 1. This is a simple C program that prints the classic "Hello world! Save this file as HelloWorld. Before we can run our code, we must compile it into an executable file.

To compile this example, we will use the C command line compiler. Now, at the command prompt, navigate to your executable's directory and run it as shown in Listing 3. Congratulations, you just wrote, compiled, and ran your first.

NET program! Not so hard, eh? With the classic "Hello world! Give your project an appropriate name, click OK, and Visual Studio creates a new solution for you that includes references to assemblies we will be using and a C file named Program.

Before we can use any geoprocessing tools or any ArcObjects components in our program, we must add references to the proper Esri assemblies to expose those functionalities. In the Solution Explorer, expand your projects tree and expand the References tree. You should see references to several System assemblies that Visual Studio sets automatically for you when it builds your solution. Right-click References and select Add Reference.

The Add Reference window may take a few seconds to come up, and when it does, select the. NET tab, scroll down through it and examine the assemblies that are available to you, especially those that begin with Esri, as those are all the Esri assemblies that contain the geoprocessing and ArcObjects functionalities that we want to expose for our use in Visual Studio.

Select Esri. Geoprocessor from the list and click OK. Notice that the assembly has been added to the References in your project. Now let's focus on Program. To access the Geoprocessor object's methods and properties, we still need to do one more thing: add a using directive to our code. The using directive has two uses: to permit the use of types and create an alias for a namespace or a type.

Every variable and constant has a type, as does every expression that evaluates to a value in a namespace i. This will soon make more sense. In Program. Add the following line inside your Main function, and instantiate create an instance of a Geoprocessor object:. Note that as you started typing "geoprocessor", Intellisense kicked in and took you right to the Geoprocessor class in the drop-down list of items available to you.

See our browser deprecation post for more details. Documentation ArcGIS add-ins and automation. Build your first add-in. Build your first configuration. Build a map identification tool. Edit attribute data. Manage add-in loading. Run an analysis task with python. Create animation keyframes. Style feature layers with an add-in. Manage the Pro UI with conditions. Build a feature construction tool. Build a map layout. ArcGIS Marketplace. Prerequisites Microsoft Visual Studio is required.

See the Installation ProGuide for more information.



0コメント

  • 1000 / 1000