Sunday, May 24, 2009

ArcEditor or ArcGIS Licence Example code

An ArcGIS Engine-based application must initialize certain environment variables and check out a license before it can execute.
First, initialize environment variables and acquire an Engine license.
EngineInitializer.initializeEngine();
AoInitialize aoInit = new AoInitialize();
aoInit.initialize(esriLicenseProductCode.esriLicenseProductCodeEngine);If you are working with the ArcGIS controls (visual JavaBeans found in the com.esri.arcgis.beans.xxxx packages), then the initialization code looks like this:
EngineInitializer. initializeVisualBeans();
AoInitialize aoInit = new AoInitialize();
aoInit.initialize(esriLicenseProductCode.esriLicenseProductCodeEngine);
If your application requires the use of an extension product, such as Spatial Analyst or 3D Analyst, then you need to check these licenses as well. This code cannot precede the initial license checkout.
aoInit.initialize(esriLicenseExtensionCode.esriLicenseExtensionCodeSpatialAnalyst);
aoInit.initialize(esriLicenseExtensionCode.esriLicenseExtensionCode3DAnalyst);

1 comment:

  1. 在莫非定律中有項笨蛋定律:「一個組織中的笨蛋,恆大於等於三分之二。」.....................................................................

    ReplyDelete