プログラミング– category –
- 
	
		
	IEngineEditEvents を使用したカスタム イベント
[csharp title="C#"] //デリゲート変数宣言 private IEngineEditEvents_Event m_pEngineEditEvents; private void Initialize() { //イベントハンドラの追加 IEngineEditor pEngineEditor = new EngineEditorClass(); m_pEngineEditEvents = (IEngineEditEvents_Event)pEngineEditor; m_pEngineEditEvents.OnVertexMoved ... - 
	
		
	WYSIWYG エディタのシンボル変更
[vb title="VBA"] Sub ChangeWYSIWYGsymbol() Dim pUID As New UID pUID = "esriEditor.Editor" Dim pApplication As IApplication Set pApplication = Application Dim pEditor As IEditor Set pEditor = pApplication.FindExtensionByCLSID(pUID) Dim pEditSketch As IEditSketch3 ... - 
	
		
	アプリケーションのカレント ディレクトリーを取得する方法
[vb title="VBA"] FileSystem.CurDir Dim pDocument As IDocument Set pDocument = ThisDocument Dim pVBProject As VBProject Set pVBProject = pDocument.VBProject Replace pVBProject.FileName, ".mxd", "" Debug.Print pVBProject.FileName [/vb] - 
	
		
	PictureFillSymbol を利用した透過塗りつぶしシンボル
[csharp title="C#"] //PictureFillSymbol オブジェクトの作成 IPictureFillSymbol pPictureFillSymbol = new PictureFillSymbolClass(); pPictureFillSymbol.CreateFillSymbolFromFile(esriIPictureType.esriIPicturePNG, @"..\..\transparency.png"); IGraphicsContainerSelect pGraphicsContainerSelect = (IGraphicsCont... - 
	
		
	ArcSDE の Workspace へアクセスする方法
[csharp title="C#"] // データベース接続情報を設定する _property.SetProperty("SERVER", "172.31.51.78"); _property.SetProperty("INSTANCE", "sde:postgresql:172.31.51.78"); //_property.SetProperty("DBCLIENT", "PostgreSQL"); _property.SetProperty("DATABASE&... - 
	
		
	Oracle スタンドアロン テーブルを直接更新する方法
[vb title="VBA"] 'ArcSDEと同居しているOracleスタンドアロンテーブルに対して更新する方法 'IWorkspace::ExecuteSQL:SQLを発行できるが戻り値が取得できない 'ITransactions:編集セッション外でトランザクションを制御するのに使用 '使用ライセンスはEditor以上、Geodataabse Updateを使用すること 'ESRI Support #631518 'IWorkspace::E... - 
	
		
	シェープファイルの空間インデックス作成
[vb title="VBA"] Attribute VB_Name = "Module1" Option Explicit Sub CheckforSpatialIndex() Dim pDoc As IMxDocument Set pDoc = ThisDocument ' マップ内の最上位レイヤを取得します。 Dim pLayer As IFeatureLayer Set pLayer = pDoc.FocusMap.Layer(0) Dim pFc As IFeatureClass Set pFc = pLayer.FeatureClass ' シェープ... - 
	
		
	属性検索時の Where 句シンタックスを調べる方法
[vb title="VBA"] Private Sub GetSpecialCharacter() 'ThisDocumentの取得 Dim pMxDocument As IMxDocument Set pMxDocument = ThisDocument 'アクティブなデータフレームの取得 Dim pMap As IMap Set pMap = pMxDocument.FocusMap '最上位レイヤの取得 Dim pLayer As IFeatureLayer Set p... - 
	
		
	フィーチャクラスの作成に必要な Fields オブジェクトの取得
[vb title="VBA"] 'FeatureClassDescriptionオブジェクトの作成 Dim pObjectClassDescription As IObjectClassDescription Set pObjectClassDescription = New FeatureClassDescription 'Fieldsオブジェクトの取得 Dim pFields As IFields Set pFields = pObjectClassDescription.RequiredFields [/vb] - 
	
		
	ComboBox に Layer オブジェクトを追加して表示名をレイヤー名にする方法
[csharp title="C#"] // クラスを作らない方法 private ILayer[] layers = null; private void Form1_Load(object sender, EventArgs e) { AxMapControl map = (AxMapControl)m_Main.Controls["axMapControl1"]; layers = new ILayer[map.LayerCount]; for (int i = 0; i < map.LayerCount; i++) { ... 
