IT– category –
-
クエリ レイヤーの作成
[vb title="VBA"] Sub CreateQueryLayer() Dim pWorkspaceFactory As IWorkspaceFactory Set pWorkspaceFactory = New SqlWorkspaceFactory Dim pPropertySet As IPropertySet Set pPropertySet = New PropertySet pPropertySet.SetProperty "DBCLIENT", "sqlserver" pPropertySet.... -
ラスターのジオリファレンス(アジャスト)残差・RMS エラーの取得
[csharp title="C#"] namespace DesktopConsoleApplication1 { class Program { private static LicenseInitializer m_AOLicenseInitializer = new DesktopConsoleApplication1.LicenseInitializer(); [STAThread()] static void Main(string[] args) { m_AOLicenseInitializer.I... -
アプリケーションのカレント ディレクトリーを取得する方法
[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] -
ランダムな色の生成
[vb title="VBA"] Dim pRgbColor As IRgbColor Set pRgbColor = New RgbColor RgbColor.Red = Int((255 * Rnd) + 1) RgbColor.Green = Int((255 * Rnd) + 1) RgbColor.Blue = Int((255 * Rnd) + 1) [/vb] -
ITransactions の使用方法
[vb title="VBA"] '1回だけ操作を元に戻す方法 Sub test() Dim pMxDocument As IMxDocument Set pMxDocument = ThisDocument Dim pMap As IMap Set pMap = pMxDocument.FocusMap Dim pFLayer As IFeatureLayer Set pFLayer = pMap.Layer(0) Dim pFClass As IFeatureClass Set pFClass = pFLayer.FeatureClass Dim pDataset As IDataset Set p... -
既存シェープファイル フィーチャクラスの取得
[vb title="VBA"] Public Function fncOpenShapefile(sPath As String, sFile As String) As IFeatureClass ' Dim sPath As String ' sPath = "D:\Data" ' ' Dim sFile As String ' sFile = "Shapefile.shp" Dim pWorkspaceFactory As IWorkspaceFactory Set pWorkspaceFactory = New ShapefileWorkspaceFactory Dim pFe... -
スタンドアロン テーブルにアクセスする方法
[vb title="VBA"] Public Sub Access2StandaloneTable() Dim pMxDocument As IMxDocument Set pMxDocument = ThisDocument Dim pStandaloneTableCollection As IStandaloneTableCollection Set pStandaloneTableCollection = pMxDocument.FocusMap Dim pStandaloneTable As IStandaloneTable Set pStand... -
フィーチャクラス作成時に Z 値の格納を許可
[csharp title="C#"] // Shapeフィールドの場所を特定します。 for (int j = 0; j < fields.FieldCount; j++) { if (fields.get_Field(j).Type == ESRI.ArcGIS.Geodatabase.esriFieldType.esriFitry) { strShapeField = fields.get_Field(j).Name; //ジオメトリタイプ・Z値を許可 IFieldEdit pGeometry... -
ArcMap の TOC で複数の選択マップやレイヤーを取得する方法
[vb title="VBA"] Sub GetSelectedItems() Dim pMxDocument As IMxDocument Set pMxDocument = ThisDocument Dim pContentsView As IContentsView Set pContentsView = pMxDocument.ContentsView(0) '最上位データフレーム Dim mySet As ISet Set mySet = New esriSystem.Set Dim pVariant As... -
IMap::Layers プロパティの第 1 引数に指定する UID を検索する方法
IMap::Layersプロパティの第1引数に指定するUIDを検索する方法 ■UIDを検索するツール UIDSearch.exe 第1引数を指定することにより、取得対象のレイヤを限定することができます。ここには、各インタフェースに割り当てられているUIDを指定します。 インタフェースに割り当てられているUIDの取得方法は以下のとおりとなります。 1.レジストリ...
