プログラミング– category –
-
全体表示コマンドの全体範囲を指定する方法
[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"); //パスはラス... -
ランダムに真偽値を取得
[csharp title="C#"] bool bln = new Random(seed).Next(100) % 2 == 0; [/csharp] -
カンマ区切りしたテキストフィールドからカラムを取得
[python title="Python"] def GetNumber(field, column): try: theText = field.split(',') theResult = int(theText[column]) return theResult except: return -999 __esri_field_calculator_splitter__ GetNumber( !TEXT!, 1) [/python] -
タイム スライダー
-
フィールド演算で測地線距離を求める方法
[python title="Python"] !shape.geodesicLength@meters! [/python] -
ArcMap のエクステンション ダイアログのチェック状態を変更する方法
[csharp title="C#"] //エクステンションのチェックを外す操作はIExtension::Shutdownイベント内では効果がない //C# //http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/inex.html#//0000000 IUID pUID = new UIDClass(); pUID.Value = "{3C5059FE-9F15-401A-94ED-EED914D73E3E}"; //Spatial Anayst I... -
印刷部数の取得
[csharp title="C#"] //印刷部数の取得(C#) private short GetCopies(IPaper pPaper) { int hDevMode; PrinterSettings pPrinterSettings; //プリンタ情報を取得する pPaper.get_PrinterInfo(out hDevMode); pPrinterSettings = new PrinterSettings(); pPrinterSettings.SetHdevmode((IntPtr)hDevMode); //部... -
ManageLifetime を使用する方法
ArcObjects のオブジェクトを開放するのに ManageLifetime を使用する方法 using ステートメントで dispose されるオブジェクトを管理 using ステートメント public static void RecyclingInappropriateExample(IFeatureClass featureClass, Boolean enableRecycling) { using(ComReleaser comReleaser = new ComReleaser()) { // Create a s...
