POST
|
Not the answer I was hoping for but still valuable. Thanks very much.
... View more
10-04-2012
10:41 AM
|
0
|
0
|
285
|
POST
|
We have ArcGIS server 10.1 running on a new server. We would like to publish a map service that reads from a 9.2 SDE (oracle) geodatabase on another older server. Is this possible? Anything special I need to do to make it happen?
... View more
10-03-2012
12:25 PM
|
0
|
5
|
634
|
POST
|
Greg: Have you tried looking at python to accomplish this task? It would probably result in a lot less code on your part. In v10.1 you will be able to associate python code with buttons on a toolbar which should make this even easier. I'm Greg's son Corbin, just using his account. I'm only just learning vb.net as a first language and introduction into comp programming. I was told by my Greg that it would be a simple start to translate our old VBA code to vb.net for use with Desktop 10. I could venture into another language eventually, but for now I think it's best I just learn one comlpletely. I don't want to be learning two languages at the same time and mixing them up.
... View more
03-09-2012
07:59 AM
|
0
|
0
|
114
|
POST
|
I figured out what was wrong. I needed to declare my FromPoint and ToPoint variables at the Class level so they would persist long enough to pick up both points. Thank you, everyone, for the help.
... View more
03-07-2012
08:36 AM
|
0
|
0
|
840
|
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. 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.
... View more
03-07-2012
07:49 AM
|
0
|
0
|
840
|
POST
|
Can you post more of the code? I ceratinly have the ability. Imports System Imports System.Collections.Generic Imports System.Text Imports ESRI.ArcGIS.ArcMapUI Imports Microsoft.VisualBasic Imports ESRI.ArcGIS.Carto Imports ESRI.ArcGIS.Geometry Imports ESRI.ArcGIS.esriSystem Imports ESRI.ArcGIS.Display Imports ESRI.ArcGIS.Framework Public Class ToolSanLineMake Inherits ESRI.ArcGIS.Desktop.AddIns.Tool Private m_ismousedown As Boolean = False Private m_linefeedback As ESRI.ArcGIS.Display.INewLineFeedback Private m_focusmap As iactiveview Protected Overrides Sub OnMouseDown(ByVal arg As ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs) MyBase.OnMouseDown(arg) 'Dim sanlineCount As Integer Dim sanMHcount As Integer Dim pLine As ILine Dim mxdoc As IMxDocument = My.ArcMap.Document m_focusmap = CType(mxdoc.FocusMap, IActiveView) 'pMxApp = My.ArcMap.Application 'pMxDoc = My.ArcMap.Document 'pMap = pMxDoc.FocusMap 'pActiveView = pMap LayerInitialize() getLayerSanitaryManholes() getLayerSanitaryLines() getTableNCsewerContracts() If layerErrorCheck() <> "" Then Exit Sub makeOrEdit = "Enter" If arg.Shift <> 0 Then ' User wants to edit an existing line rather than make a new one 'Call SanLineEdit_MouseDown(ByVal button, ByVal shift, ByVal x, ByVal y) MsgBox("User wants to edit") Exit Sub End If Dim pFeatureSelection As ESRI.ArcGIS.Carto.IFeatureSelection Dim FromPoint As New Point 'Select two manholes and draw a line in sanline layer 'Get the first manhole feature, store the coordinates and type 'If the global variable is 0, get the new point (tests for the first or second selection) If startSect = 0 Then pFeatureSelection = GetSelectionGeometry(sanmhFeatLyr, x, y) sanMHcount = pFeatureSelection.SelectionSet.Count If sanMHcount = 0 Then MsgBox("No manhole was selected.") Exit Sub ElseIf sanMHcount > 1 Then MsgBox("You have selected " & sanMHcount & " manholes. Select the first manhole.") Exit Sub End If startSect = 1 'Get the GID field from poles table and store it in GFKPOLEST pFeatureSelection.SelectionSet.Search(Nothing, True, sanmhFeatCursor) sanmhFeature = sanmhFeatCursor.NextFeature 'Test for null manhole ID field: save point or display message box sanlineGfkMHfromVal = checkNullGUID2(sanmhFeature, sanmhGIDfld) sanmhMHUPrimElevVal = checkNullNumber(sanmhFeature, sanmhMHrimElevFld) 'sanlineGfkMHfromVal = checkNullString(sanmhFeature, sanmhLegacy_IDfld) 'Debug.Print "sanmhMHUPrimElevVal = " & sanmhMHUPrimElevVal FromPoint = sanmhFeature.Shape Else 'Get the second manhole feature, store the coordinates and type Dim plFeatureSelection As ESRI.ArcGIS.Carto.IFeatureSelection Dim ToPoint As New Point plFeatureselection = GetSelectionGeometry(sanmhFeatLyr, x, y) sanMHcount = plFeatureselection.SelectionSet.Count 'If No Selection is made Messagebox pops up If sanMHcount = 0 Then MsgBox("No manhole was selected. Please try again.") Exit Sub ElseIf sanMHcount > 1 Then 'If selection is more than one manhole then again Messagebox pops up MsgBox("You have selected " & sanMHcount & " manholes. Select only one.") Exit Sub End If 'Get the GID field from the manholes table plFeatureSelection.SelectionSet.Search(Nothing, True, sanmhFeatCursor) sanmhFeature = sanmhFeatCursor.NextFeature ToPoint = sanmhFeature.Shape sanlineGfkMHtoVal = checkNullGUID2(sanmhFeature, sanmhGIDfld) sanmhMHrimElevVal = checkNullString(sanmhFeature, sanmhMHrimElevFld) sanmhLegacy_IDVal = checkNullString(sanmhFeature, sanmhLegacy_IDfld) 'Check to make sure that the same manhole was not selected twice If sanlineGfkMHfromVal = sanlineGfkMHtoVal Then MsgBox("The second manhole selected has the same GID number as the first. Select both manholes again.") startSect = 0 Exit Sub End If If (sanlineGfkMHfromVal = GUID000) Or (sanlineGfkMHtoVal = GUID000) Then MsgBox("One or both of the selected manholes is missing its GID value. The line cannot be made until a GID is created.") startSect = 0 Exit Sub End If startSect = 0 'Draw line between points Dim calcLength As Double = 0 pSegmentCollection = New Path pLine = New Line Debug.Print("calcLength = " & calcLength) Debug.Print("1") 'Draw a line between first point and second point (FromPoint and ToPoint) pLine.PutCoords(ToPoint, FromPoint) Debug.Print("2") calcLength = pLine.Length ''***Crashes ArcMap here. Something is wrong with pLine.Length*** Debug.Print("calcLength = " & calcLength) Debug.Print("pLine.Length = " & pLine.Length) Debug.Print("3") pSegmentCollection.AddSegment(pLine) Debug.Print("4") Dim FormSanLineEdit1 As New FormSanLineEdit FormSanLineEdit1.ShowDialog() m_focusmap.Refresh() End If End Sub End Class
... View more
03-07-2012
06:49 AM
|
0
|
0
|
840
|
POST
|
Still need help. This is the exception that I got when I changed it over from user handled: System.Runtime.InteropServices.COMException {"The operation was attempted on an empty geometry."}
... View more
03-07-2012
06:09 AM
|
0
|
0
|
840
|
POST
|
Hi, I'm attempting to fix someone's code that draws a line betweent two points. I'm converting it from VBA to VB .NET. This section appears to be where it's failing. Right after Debug 8.1 or 8.2 'Draw line between points Dim calcLength As Double pSegmentCollection = New Path pLine = New Line 'Draw a line between first point and second point (FromPoint and ToPoint) pLine.PutCoords(ToPoint, FromPoint) Debug.Print("8.1") calcLength = pLine.Length Debug.Print("8.2") pSegmentCollection.AddSegment(pLine) Debug.Print("8.3") Any help is appreciated. Thank you, cdebruin
... View more
03-07-2012
05:34 AM
|
0
|
10
|
2514
|
POST
|
Thank you! I see what you mean by creating instances of the generic windows form class as opposed to my own form. I fixed the code. Thanks again.
... View more
03-05-2012
08:04 AM
|
0
|
0
|
1136
|
POST
|
Hi, I'm in the process of converting code from VBA to VB. NET, and I'm having trouble calling a form I created from a button. Here's what I've tried so far: Protected Overrides Sub OnClick() Dim FormLogin As New System.Windows.Forms.Form FormLogin.Show() End Sub This brings up the form, but it's a completely blank form, which the form I'm attempting to call is not. Any help is appreciated. Thank you, cdebruin
... View more
03-05-2012
06:01 AM
|
0
|
11
|
6006
|
POST
|
Thank you for the support. I've since given up on building off less than adequate ESRI samples and moved onto building a new solution from scratch.
... View more
03-01-2012
02:51 AM
|
0
|
0
|
356
|
POST
|
After playing around a bit, I've discovered that arbitrarily building the solution three times fixes the problem. The first build gives me the "Cannot register assembly" error. Second build after no changes made to code yields "build failed." Third build after no changes made to coded yields "build succeeded," and the program works as it should. I'll reiterate that no changes were made to code. Fingers off the keyboard, cursor not leaving the build menu, no changes made to code. I'd still like an explanation here. My mind isn't at ease even with the program working, and I can't be forced to build the solution three times after every code edit.
... View more
02-29-2012
08:50 AM
|
0
|
0
|
356
|
POST
|
Hello all, I'm new to programming and, as an introduction, I'm trying to add a tool to existing sample code I took from ESRI, SelectionSample2008. The problem is that it seems if I change anything, even if I change it back perfectly with ctrl-z, the project no longer builds. I get this error: Cannot register assembly "H:\AppDev\Visual Studio 2010\Projects\GdBSanitaryFromSelectionAddInSample\bin\Debug\GbdSanitary.dll". Could not load file or assembly 'ESRI.ArcGIS.Desktop.AddIns, Version=10.0.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86' or one of its dependencies. The system cannot find the file specified. SelectionSample2008 Can someone please explain to me the nature of this error, or perhaps point me in the direction of a resource, walkthrough or link for adding tools to existing toolbars/extensions? Any help is greatly appreciated. Thank you, cdebruin
... View more
02-29-2012
05:24 AM
|
0
|
4
|
463
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|