POST
|
I have a model builder that creates a MobileCache (using the Mobile Tool) and a python script that empties the MobileCache folder. I want the script to run first, then the Mobile Tool, but I can't seem to find a way. Using a precondition does not work. I'm using ArcGIS 10.0.
... View more
06-04-2014
09:48 AM
|
0
|
1
|
2723
|
POST
|
Got it! Dim pMap As IMxDocument = My.ArcMap.Document Dim pCache As IMapCache = pMap.FocusMap ' Enable (checkmark) the Automatically build cache... pCache.AutoCacheActive = True ' Enable (checkmark) the set minimum scale for caching pCache.ScaleLimit = True ' Set scale for caching pCache.MaxScale = 100000
... View more
01-23-2014
08:58 AM
|
0
|
0
|
269
|
POST
|
I'm trying to find examples on how the IMapCache Interface works, but I can't seem to find much on that. I'm trying to build a tool in VB.NET that will always start ArcMap with the Auo-Cache on and set to a Maximum Scale for the Cache. Basically, I just want to enabled everything in the Feature Cache Tab, in the Data Frame Properties. Anyone can point me to the right direction? IMapCache Interface: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//001200000830000000
... View more
01-23-2014
04:29 AM
|
0
|
3
|
518
|
POST
|
Thanks again! It's funny that you can use the IDisplayTransformation Interface to change the Map Units, but you can't use it to change the Display Units. There are no members for it. Also, I might be missing a Reference, because I get an error on the esriMeters Constant. That's why I use the Constant Value, instead. http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//004200000030000000
... View more
01-22-2014
02:35 AM
|
0
|
0
|
371
|
POST
|
Using VB.NET, I created a function that will always start ArcMap with a certain Projected Coordinate System. By default, the Map Units and Display Units (Data Frame) are set to Meters, when using this Spatial Reference. How can I change the Display Units? I know how to change the Map Units to Kilometers (10), but how can I modify the code to change the Display Units? Dim dataView As IActiveView = My.ArcMap.Document.ActiveView dataView.ScreenDisplay.DisplayTransformation.Units = 10 dataView.Refresh()
... View more
01-21-2014
09:41 AM
|
0
|
2
|
2596
|
POST
|
Using VB.NET, I'm trying to rotate the display view, like the Rotation option in the Data Frame Properties. I can only find VBA codes on it and I'm trying to convert it into .NET, but I'm having trouble. Dim pMap As IMap = My.ArcMap.Document.ActiveView Dim pActiveView As IActiveView = pMap.FocusMap pActiveView.ScreenDisplay.DisplayTransformation.Rotation = 90 pActiveView.Refresh()
... View more
01-21-2014
05:46 AM
|
0
|
2
|
787
|
POST
|
Got it! I had to replace this:
Dim pFact As IWorkspaceFactory = New AccessWorkspaceFactory
with this:
Dim pFact As IWorkspaceFactory = New FileGDBWorkspaceFactoryClass()
... View more
12-20-2013
09:30 AM
|
0
|
0
|
149
|
POST
|
I'm trying to access a Feature Class in a GDB and list its Field Names. The FC is not in the TOC/ActiveView, I want to access it directly. This is what I have so far:
Public Sub ListFields()
Dim fieldList As String = ""
Dim pFact As IWorkspaceFactory = New AccessWorkspaceFactory
Dim pWorkspace As IWorkspace = pFact.OpenFromFile("G:\Data\GDB\Production.gdb", 0)
Dim pFeatureWorkSpace As IFeatureWorkspace = pWorkspace
Dim pFeatureClass As IFeatureClass = pFeatureWorkSpace.OpenFeatureClass("LandSea")
Dim fields As IFields = pFeatureClass.Fields
Dim field As IField = Nothing
For i As Integer = 0 To fields.FieldCount - 1
field = fields.Field(i)
fieldList = fieldList + field.Name + vbNewLine
Next i
MsgBox(fieldList)
End Sub
... View more
12-20-2013
08:23 AM
|
0
|
1
|
506
|
POST
|
OK, thanks! I'll create another string to append all the names.
... View more
12-20-2013
05:35 AM
|
0
|
0
|
268
|
POST
|
Makes sense. But, this is the code I found here, in the ESRI Developer Network: http://edndoc.esri.com/arcobjects/9.2/NET/74749fb9-9724-465f-9e1c-32c6faec1d5e.htm
... View more
12-20-2013
03:23 AM
|
0
|
0
|
268
|
POST
|
I'm using a VB.NET code found in the ESRI Resource Center to list the content of a GDB. For some reasons, it's not working. It hangs or I get an empty string value. Here's my code:
Imports ESRI.ArcGIS.Geodatabase
Imports ESRI.ArcGIS.Carto
Imports ESRI.ArcGIS.esriSystem
Imports System.Windows.Forms
Imports ESRI.ArcGIS.Geoprocessing
Imports ESRI.ArcGIS.Geoprocessor
Public Sub test()
Dim gp As New ESRI.ArcGIS.Geoprocessor.Geoprocessor
gp.SetEnvironmentValue("workspace", "G:\Data\GDB\Production.gdb")
Dim fcs As ESRI.ArcGIS.Geoprocessing.IGpEnumList = gp.ListFeatureClasses("*", "", "")
Dim fc As String = fcs.Next()
Do While fc <> ""
fc = fc + vbNewLine + fcs.Next()
Loop
MsgBox(fc)
End Sub
... View more
12-19-2013
10:01 AM
|
0
|
4
|
539
|
POST
|
Finally found the answer here: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//0001000000zz000000 I have to use the Update() method. This is my code:
Protected Overloads Overrides Sub OnUpdate()
' Disabled if in Layer View
If TypeOf My.ArcMap.Document.ActiveView Is IPageLayout Then
Me.Enabled = False
ElseIf TypeOf My.ArcMap.Document.ActiveView Is IMap Then
Me.Enabled = True
End If
End Sub
... View more
12-12-2013
08:02 AM
|
0
|
0
|
334
|
POST
|
I created a VB.NET Add-In tool that adds layers to the map, from a Layer List ComboBox. Everything works fine, but I do not want the tool to work when in Layout View. I know how to verify if I'm in the Layout View and display a message, but I would like to disable the ComboBo, instead of a message box. How can I modify my code to accomplish this?
If TypeOf My.ArcMap.Document.ActiveView Is IPageLayout Then
MsgBox("Switch to Data View to run the tool")
Return
End If
... View more
12-12-2013
05:39 AM
|
0
|
3
|
783
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|