|
POST
|
If you look at the help about ILayer::SpatialReference, you'll see that lets you set the property but not get it (i.e. you can't get information about it directly). There's a snippet called "Get Spatial Reference from Dataset" that will return the spatial reference. You'll be able to get its name from that.
... View more
04-17-2012
12:19 PM
|
0
|
0
|
1165
|
|
POST
|
Take a look at this post over in GIS.StackExchange and Derek Swingley's response.
... View more
04-17-2012
05:21 AM
|
0
|
0
|
1674
|
|
POST
|
Look at MSDN help for the full documentation, but here's an example of how I use it. Here, I have already added the StatusStrip (StatusStrip1) to the form. Unfortunately, this example doesn't do anything with a progress bar, but that can also be added.
'form initialization subroutine
StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {toolStripStatusLabel1})
StatusStrip1.LayoutStyle = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow
StatusStrip1.Location = New System.Drawing.Point(0, 0)
StatusStrip1.Name = "statusStrip1"
StatusStrip1.ShowItemToolTips = True
StatusStrip1.Size = New System.Drawing.Size(292, 22)
StatusStrip1.Text = "statusStrip1"
toolStripStatusLabel1.Name = "toolStripStatusLabel1"
toolStripStatusLabel1.Size = New System.Drawing.Size(109, 17)
toolStripStatusLabel1.Text = "toolStripStatusLabel1"
StatusStrip1.Visible = False
'processing code
Try
StatusStrip1.Visible = True
toolStripStatusLabel1.Text = "Starting"
StatusStrip1.Refresh()
'more code
toolStripStatusLabel1.Text = "Processing layer " & pLayer.Name
StatusStrip1.Refresh()
'more code
Catch ex As Exception
System.Windows.Forms.MessageBox.Show(ex.ToString, "Run")
Finally
StatusStrip1.Visible = False 'Make it invisible when finished or in case the process crashes early
End Try
... View more
04-10-2012
08:08 AM
|
0
|
0
|
3071
|
|
POST
|
Have you also released all the variable references to the file? Take a look at this 9.2 help page on some of the different options.
... View more
04-10-2012
06:59 AM
|
0
|
0
|
983
|
|
POST
|
Here's how I set the Windows Wait Cursor (in VB.NET) Windows.Forms.Cursor.Current = Windows.Forms.Cursors.WaitCursor The other thing I've done in some of my forms is to add a StatusStrip. In there, I've placed progress bars and messages to give the user an idea of what's happening as the application goes through its steps. [ATTACH=CONFIG]13380[/ATTACH][ATTACH=CONFIG]13381[/ATTACH][ATTACH=CONFIG]13382[/ATTACH]
... View more
04-10-2012
06:24 AM
|
0
|
0
|
3071
|
|
POST
|
Here's an example of stepping through all the unique values using DataStatistics in VB.NET
Dim pEnumerator As System.Collections.IEnumerator
pEnumerator = pData.UniqueValues
pEnumerator.Reset()
Do While pEnumerator.MoveNext
value = pEnumerator.Current
pQF = New QueryFilter
pQF.WhereClause = "typeAndNum = '" & value & "'" 'change to match FC attribute with multiple records
'etc
Loop
... View more
04-09-2012
10:33 AM
|
0
|
0
|
1594
|
|
POST
|
Does the mouse wheel work if you click on the map first?
... View more
04-05-2012
01:15 PM
|
0
|
0
|
1811
|
|
POST
|
You can use this syntax where DATE_ is your date field: DatePart("yyyy",[Date_])
... View more
03-21-2012
06:34 AM
|
1
|
0
|
2355
|
|
POST
|
Take a look at Derek Swingley's post in this thread over on GIS.StackExchange.com
... View more
03-16-2012
07:52 AM
|
0
|
0
|
1306
|
|
POST
|
I just ran a test with the application that uses this code and I didn't receive an error when I created a new dataset in the directory C:\temp\New Folder\. This is on a Win 7 machine. Where are you getting the error?
... View more
03-09-2012
04:57 AM
|
0
|
0
|
923
|
|
POST
|
I would get rid of using the ComReleaser altogether. Here is the proper way to get a cursor and loop through it as well as clean up the objects that it uses: Neil, why do you suggest not using ComReleaser?
... View more
03-08-2012
10:11 AM
|
0
|
0
|
2287
|
|
POST
|
Try this: dim blnFound as Boolean blnFound = False For j = 0 To listbox2.listcount -1 value = listbox2.list(j) If InStr(value, "Well") Then blnFound = True End If next j If blnFound Then MsgBox "YES" End If
... View more
03-08-2012
09:13 AM
|
0
|
0
|
728
|
|
POST
|
This is how I create a new feature class using the Geoprocessor in my add-in
Friend Function CreateFeatureClass(ByVal FCLocation As String, ByVal FCName As String, ByVal pSR As ESRI.ArcGIS.Geometry.ISpatialReference3, ByVal GeometryType As String) As ESRI.ArcGIS.Geodatabase.IFeatureClass
Dim CreateFClass As New ESRI.ArcGIS.DataManagementTools.CreateFeatureclass
Dim Result As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2
Try
Using releaser As New ESRI.ArcGIS.ADF.ComReleaser
releaser.ManageLifetime(CreateFClass)
CreateFClass.out_path = FCLocation
CreateFClass.out_name = FCName
CreateFClass.spatial_reference = pSR
CreateFClass.geometry_type = GeometryType
Result = RunTool(CreateFClass, Nothing, True)
If Result Is Nothing Then Return Nothing
Return ReturnObjectfromResult(Result, "Feature Class")
End Using
Catch ex As Exception
System.Windows.Forms.MessageBox.Show(ex.ToString & vbNewLine & ex.StackTrace.ToString, "Create Feature Class")
Return Nothing
End Try
End Function
Friend Function ReturnObjectfromResult(ByVal result As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult2, ByVal Type As String) As Object
Dim GPVal As ESRI.ArcGIS.Geodatabase.IGPValue
Dim InMemFC As String
Dim GPUtil As ESRI.ArcGIS.Geoprocessing.IGPUtilities3 = New ESRI.ArcGIS.Geoprocessing.GPUtilities
Try
GPVal = result.GetOutput(0)
InMemFC = GPVal.GetAsText()
Select Case Type
Case "Feature Class"
Return GPUtil.OpenFeatureClassFromString(InMemFC)
Case "Table"
Return GPUtil.OpenTableFromString(InMemFC)
Case "Feature Layer"
Return GPUtil.OpenFeatureLayerFromString(InMemFC)
End Select
Catch ex As Exception
System.Windows.Forms.MessageBox.Show(ex.ToString, "Return FeatureClass error")
Return Nothing
End Try
End Function
Friend Function RunTool(ByVal Process As ESRI.ArcGIS.Geoprocessor.IGPProcess, ByVal TC As ESRI.ArcGIS.esriSystem.ITrackCancel, Optional ByVal AddOutput As Boolean = False) As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult
Dim Result As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult
Try
System.Windows.Forms.Cursor.Current = Windows.Forms.Cursors.WaitCursor
Dim GP as New ESRI.ArcGIS.Geoprocessor.Geoprocessor
GP.OverwriteOutput = True
GP.AddOutputsToMap = AddOutput
Result = CType(GP.Execute(Process, Nothing), ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult)
If Result.Status <> ESRI.ArcGIS.esriSystem.esriJobStatus.esriJobSucceeded Then
Return Nothing
End If
Return Result
Catch ex As Exception
Return Nothing
End Try
End Function
... View more
03-08-2012
08:00 AM
|
0
|
0
|
923
|
|
POST
|
I've officially been computer programming for two weeks, and I have no idea how to display the values of Point or Line objects/data types. I have been using breakpoints and debugging tools to step through the code, which is how I hit the error. Also, It's not my code, I'm just trying some minimal fixes to get it working again. All the code I've written so far has been explicitly declared. You can look at the values in a couple of ways. First, when the code hits the breakpoint, if you put your cursor over a variable, it will show you information about it. If you open the Locals window (Debug|Windows|Locals), you'll see a listing of all the variables used in your code. You can set up Watches on specific variables.
... View more
03-07-2012
08:51 AM
|
0
|
0
|
2867
|
|
POST
|
Are you using the debugging tools to put in breakpoints so that you can evaluate the values of ToPoint, FromPoint, and pLine? In looking through your code, I also notice that you don't declare many of your variables. This can come back to haunt you later.
... View more
03-07-2012
07:37 AM
|
0
|
0
|
2867
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-04-2025 06:39 AM | |
| 1 | 05-01-2026 08:26 AM | |
| 1 | 04-10-2026 12:01 PM | |
| 1 | 04-13-2026 09:11 AM | |
| 1 | 10-11-2023 06:18 AM |
| Online Status |
Offline
|
| Date Last Visited |
2 weeks ago
|