ArcGIS– category –
- 
	
		
	ArcMap の基本オブジェクトへのアクセス
[vb title="VBA"] Public Sub Test() '現在のドキュメントを取得 Dim pMxDocument As IMxDocument Set pMxDocument = ThisDocument 'アクティブなデータフレームの取得 Dim pMap As IMap Set pMap = pMxDocument.FocusMap 'レイヤを取得 Dim pLayer As ILayer Set pLayer = pMap.Layer(0) '... - 
	
		
	IMapDocument の使用方法
[vb title="VBA"] Public Sub OpenMapDocument() Dim pMapDocument As IMapDocument Set pMapDocument = New MapDocument pMapDocument.Open "D:\Workspace\MapDocument.mxd" '任意のデータフレームを取得 Dim pActiveView As IMap Set pActiveView = pMapDocument.Map(0) pMapDocu... - 
	
		
	エレメントの拡大
[vb title="VBA"] Public Sub ScaleElement() Dim pMxDocument As IMxDocument Set pMxDocument = ThisDocument Dim pGraphicsContainerSelect As IGraphicsContainerSelect Set pGraphicsContainerSelect = pMxDocument.PageLayout Dim pElement As IElement Set pElement = pGraphicsContainerSelect.... - 
	
		
	全体表示コマンドの全体範囲を指定する方法
[vb title="VBA"] Sub setFullExtent() Dim pMxDocument As IMxDocument Set pMxDocument = ThisDocument Dim pMap As IMap Set pMap = pMxDocument.FocusMap Dim pActiveView As IActiveView Set pActiveView = pMap Dim pFeatureLayer As IFeatureLayer Set pFeatureLayer = pMap.Layer... - 
	
		
	パスが切れたデータ ソースの取得
[vb title="VBA"] Sub GetOriginalPath() 'ThisDocumentの取得 Dim pMxDocument As IMxDocument Set pMxDocument = ThisDocument 'アクティブなデータフレームの取得 Dim pMap As IMap Set pMap = pMxDocument.FocusMap '最上位レイヤの取得 Dim pLayer As IDataLayer Set pLayer = pMap.La... - 
	
		
	ラスターデータセットの変更がレイヤーに反映されない場合の対処
[csharp title="C#"] IDataLayer2 pDataLayer = (IDataLayer2)pLayer; pDataLayer.Disconnect(); //データ ソースを切断(必須ではありませんが、明示的に古いデータ参照を切断します) IRasterLayer pRasterLayer = (IRasterLayer )pLayer; pRasterLayer.CreateFromFilePath(@"D:\fgdb\fgdb_1.gdb\RasterLayer"); //パスはラス... - 
	
		
	円グラフィックから中心座標と半径を取得
[javascript title="JavaScript"] var graphic = new Graphic(evt.geometry, symbol); var extent = graphic.geometry.getExtent(); //グラフィックからジオメトリの Extent を取得 var center = extent.getCenter(); // Extent から中心(Point)を取得 window.alert("X:" + center.x + ", Y:" + center.y + " ... - 
	
		
	フィーチャクラスの作成
[python title="Python"] # coding: utf-8 ''' pythonでフィーチャクラスを作成するテスト ''' import os, sys, arcgisscripting import math def Usage(): print u'%(exe)s ワークスペース名 入力CSVファイル名 出力シェープファイル名' % { 'exe' : (os.path.basename(sys.argv[0])) } def NmeaXy2Deg(val): ''' 60... - 
	
		
	UID 名から ICommand を取得
[csharp title="C#"] using ESRI.ArcGIS.SystemUI; using ESRI.ArcGIS.esriSystem; using ESRI.ArcGIS.Framework; public static ICommand GetCommandByName(string UIDName) { IUID pUID = new UIDClass(); pUID.Value = UIDName; // ex:"EsriJapan_SupportTool_ReferenceID" ICommandItem pCommandItem = ((IDocum... - 
	
		
	アクティブ ビューを画像にエクスポート
[vb title="VBA"] Public Sub ExportJPEG() Dim ExportFileName As String ExportFileName = "D:\Workspace\output.jpg" Dim ExportResolution As Integer ExportResolution = 300 &nbs... 
