Marko Apfel - Afghanistan/Belgium/Germany

Management, Architecture, Programming, QA, Coach, GIS, EAI

  Home  |   Contact  |   Syndication    |   Login
  187 Posts | 2 Stories | 201 Comments | 4 Trackbacks

News



Twitter | LinkedIn | Xing

Archives

Post Categories

BizTalk

C#

Enterprise Library

SAP

SQL Server

Technologie

After having a first look on F# its time to ask: How could i use F# with ArcObjects.

So my first steps was to do something with a feature in a F# interactive session.
And these are my first code lines:

open System;;

#I "C:\Program Files\ArcGIS\DotNet";;
#r "ESRI.ArcGIS.System.dll";;
#r "ESRI.ArcGIS.DataSourcesGDB.dll";;
#r "ESRI.ArcGIS.Geodatabase.dll";;
open ESRI.ArcGIS.esriSystem;;
open ESRI.ArcGIS.DataSourcesGDB;;
open ESRI.ArcGIS.Geodatabase;;

let aoInitialize = new AoInitializeClass();;

let status = aoInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcEditor);;

let workspacefactory = new SdeWorkspaceFactoryClass();;

let connection = "SERVER=okul;DATABASE=p;VERSION=sde.default;INSTANCE=sde:sqlserver:okul;USER=s;PASSWORD=g";;

let workspace = workspacefactory.OpenFromString(connection, 0);;

let featureWorkspace = (box workspace) :?> IFeatureWorkspace;;

let featureClass = featureWorkspace.OpenFeatureClass("Praxair.SFG.BP_L_ROHR");;

let feature = featureClass.GetFeature(100);;
printfn "%A" feature.OID;;

 

posted on Thursday, March 25, 2010 10:58 AM