IT– category –
-
BLOB 型にオブジェクトを読込・保存する方法
[vb title="VBA"] '任意のファイルをテーブルの属性値に保存・読込 Private Sub StoreMemoryBlobStream() Dim strFileName As String Dim strPGDBName As String Dim strTableName As String Dim strField As String Dim blnFileLoad As Boolean strFileName = "D:\Workspace\BinaryFile.bin" ... -
印刷部数の取得
[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... -
BufferConstruction を使用したバッファー作成
[csharp title="C#"] Type t = Type.GetTypeFromProgID ("esriGeometry.SpatialReferenceEnvironment"); ISpatialReferenceFactory pSpatialReferenceFactory = (ISpatialReferenceFactory)Activator.CreateInstance(t); ISpatialReference wgs84 = pSpatialReferenceFactory.CreateGeographicCoordinateSystem(4326); //WGS84 ... -
空間参照のエクスポート
[vb title="VBA"] 'ThisDocumentの取得 Dim pMxDocument As IMxDocument Set pMxDocument = ThisDocument 'アクティブなデータフレームの取得 Dim pMap As IMap Set pMap = pMxDocument.FocusMap '空間参照オブジェクトの取得 Dim pESRISpatialReference As IESRISpatialReference Set pESRISpatialReference = pMap.SpatialReference ... -
地球の裏の緯度経度を求める
[vb title="VBA"] Public Function GetBackLatLon(FromPoint As IPoint) As IPoint '入力座標が地理座標系でない場合、Nothingを返す If FromPoint.SpatialReference Is Nothing Then Set GetBackLatLon = Nothing Exit Function ElseIf Not TypeOf FromPoint.SpatialReference Is IGeographicCoordinateSystem ... -
SimpleMarker3DSymbol の作成
[vb title="VBA"] Dim pRgbColor As IRgbColor Set pRgbColor = New RgbColor pRgbColor.Red = 255 pRgbColor.Green = 0 pRgbColor.Blue = 0 Dim pSimpleMarker3DSymbol As ISimpleMarker3DSymbol Set pSimpleMarker3DSymbol = pMultilayerMarkersymbol.layer(0) 'New SimpleMarker3DSymbol pSimpleMarker3DSymbol.ResolutionQuality = 0.5... -
描画の一時停止
[vb title="VBA"] Dim pMxApplication As IMxApplication2 Set pMxApplication = Application pMxApplication.PauseDrawing = True '描画の一時停止 pMxApplication.PauseDrawing = False '描画の再開 [/vb] -
クリップボードにマップのグラフィックをコピー
[csharp title="C#"] // http://forums.esri.com/Thread.asp?c=159&f=1707&t=268556 private void axMapControl1_OnMouseDown(object sender, IMapControlEvents2_OnMouseDownEvent e) { IRubberBand pRubberPoly = new ESRI.ArcGIS.Display.RubberEnvelopeClass(); IEnvelope myenv = pRubberPoly.TrackNew(this.axMapC... -
UtilityNetworkAnalysisExt オブジェクトの取得と解析結果オプションの変更
ユーティリティネットワーク解析 ツールバー → 解析 → オプションから設定する、解析オプション ダイアログの解析結果 タブは以下のようにアクセスして設定します。 IApplication::FindExtensionByCLSID を用いて、UtilityNetworkAnalysisExt オブジェクトを取得します。このオブジェクトにあるプロパティで、ダイアログ内の設定を変更できま...
