|
POST
|
You'd just have to comment out where it checks if the layer is a Feature Layer Do While Not (pLayer Is Nothing) 'If TypeOf pLayer Is IFeatureLayer Then pLayer.Visible = True pActiveView.extent = pLayer.AreaOfInterest pActiveView.Refresh ExportLayout "GIF", "C:\Users\Desktop\" & pLayer.Name & ".gif", 175 'System.Windows.Forms.MessageBox.Show (pLayer.Name) pLayer.Visible = False 'End If Set pLayer = pEnumLayer.Next Loop Don't forget to mark the answer as correct and/or helpful
... View more
02-13-2012
08:33 AM
|
0
|
0
|
3808
|
|
POST
|
Most of it will go over directly. You'll have to add in "Set" to some of the statements and you won't need the fully qualified declarations (Dim activeView As IActiveView instead of Dim activeView As ESRI.ArcGIS.Carto.IActiveView, for example).
... View more
02-10-2012
11:19 AM
|
0
|
0
|
870
|
|
POST
|
Here is some code written in VB.NET ( so you'll have to do some slight modifications for VBA) that will loop through the table of contents three times. The code first gets the original extent of the activeview. The first loop will turn off all the layers. The second loop will turn on a layer and zoom to its extent, pops up a message box to pause the operation, then turns the layer off. The third loop turns the layers back on once again. Finally, the activeview is set back to the original extent.
Dim activeView As ESRI.ArcGIS.Carto.IActiveView
activeView = pMxDoc.ActiveView
Dim extent As ESRI.ArcGIS.Geometry.IEnvelope
extent = activeView.Extent
Dim pMap As ESRI.ArcGIS.Carto.IMap
pMap = pMxDoc.FocusMap
Dim enumLayer As ESRI.ArcGIS.Carto.IEnumLayer
enumLayer = pMap.Layers
enumLayer.Reset()
Dim layer As ESRI.ArcGIS.Carto.ILayer
layer = enumLayer.Next
Do While Not (layer Is Nothing)
layer.Visible = False
layer = enumLayer.Next
Loop
enumLayer.Reset()
layer = enumLayer.Next
Do While Not (layer Is Nothing)
If TypeOf layer Is ESRI.ArcGIS.Carto.IFeatureLayer Then
layer.Visible = True
activeView.Extent = layer.AreaOfInterest
activeView.Refresh()
System.Windows.Forms.MessageBox.Show(layer.Name)
layer.Visible = False
End If
layer = enumLayer.Next
Loop
enumLayer.Reset()
layer = enumLayer.Next
Do While Not (layer Is Nothing)
layer.Visible = True
layer = enumLayer.Next
Loop
activeView.Extent = extent
activeView.Refresh()
... View more
02-07-2012
11:30 AM
|
0
|
0
|
2938
|
|
POST
|
I'm having difficulty in trying to understand your goals. Can you provide an illustration of what you're trying to achieve?
... View more
02-07-2012
09:14 AM
|
0
|
0
|
2938
|
|
POST
|
This has started happening on my projects when I switched to FB 4.6
... View more
02-07-2012
09:03 AM
|
0
|
0
|
2817
|
|
POST
|
This tool has been working well, but when I upgraded to FG 4.6, I'm getting the broken link to the Pan/Zoom In/Zoom Out images also. This is with both pre-sparked version for the 2.3.1 API as well as the version for 2.4. The images appear when I mouse over them. [ATTACH=CONFIG]11760[/ATTACH]
... View more
02-07-2012
08:58 AM
|
0
|
0
|
2697
|
|
POST
|
Have you considered using IdentifyTask instead? IdentifyParameters contains a property for setting the tolerance in screen pixels.
... View more
02-01-2012
06:08 AM
|
0
|
0
|
1050
|
|
POST
|
Your problem is here
' is this the first time through?
Dim m_pFeatCur As IFeatureCursor
Dim testVal As String
If m_pFeatCur Is Nothing Then
m_pFeatCur = pFeatureLayer.Search(Nothing, False)
Else
'Use messages to find cause of error - not working though!
MessageBox.Show("Cursor WAS found!")
End If
Every time you click the button you're declaring the cursor, so it will be evaluated as Nothing. You have to declare m_pFeatCur outside of this sub. Take a look at the original script again and look at where it was declared.
... View more
02-01-2012
05:50 AM
|
0
|
0
|
805
|
|
POST
|
From the help: IPage is the primary interface on the Page object. Use this interface to access all the properties of an ArcMap page, including the border, background, background color, orientation, and size.
... View more
02-01-2012
05:36 AM
|
0
|
0
|
1006
|
|
POST
|
Please post your code so we can see how you've declared and instantiated the cursor.
... View more
02-01-2012
04:28 AM
|
0
|
0
|
805
|
|
POST
|
It's in ESRI.ArcGIS.ADF.ComReleaser. In ArcGIS 10, you have to add the reference ESRI.ArcGIS.ADF.Connection.Local
... View more
01-27-2012
10:15 AM
|
0
|
0
|
1989
|
|
POST
|
Have you tried either Dim objMxDoc As IMxDocument objMxDoc = New MxDocument or Dim objMxDoc As New MxDocument
... View more
01-24-2012
04:59 AM
|
0
|
0
|
757
|
|
POST
|
If you want to get a better idea of the order in which code functions, put in breakpoints at various points. This will show you how the program is progressing.
SearchSaleTable(PinArray); // send array to function
trace("The very last value " + nsum);
private function SearchSaleTable(tmp:ArrayCollection):Number
{[INDENT]// loops thru the pin's to search Sale table [/INDENT]
[INDENT]
cursor = tmp.createCursor();[/INDENT]
[INDENT]var t:String = new String;[/INDENT]
[INDENT]while(!cursor.afterLast)[/INDENT]
[INDENT]{ [/INDENT]
[INDENT=2]t = cursor.current.toString();[/INDENT]
[INDENT=2]var saleQueryTask:QueryTask = new QueryTask(); [/INDENT]
[INDENT=2]
saleQueryTask.url = "my url";
saleQueryTask.showBusyCursor = true;
saleQueryTask.useAMF = false;[/INDENT]
[INDENT=2]sQuery.where = "SAPROP = '" + t + "'" ;
saleQueryTask.execute(sQuery, new AsyncResponder(onResult, onFault));
function onResult(featureSet:FeatureSet, token:Object = null):Number
{[/INDENT]
[INDENT=3]nsum = 0; <-- put breakpoint here
[/INDENT]
[INDENT=3]for each (var g:Graphic in featureSet.features)[/INDENT]
[INDENT=3]{[/INDENT]
[INDENT=4]nsum += g.attributes.SAPRICE; [/INDENT]
[INDENT=3]}[/INDENT]
[INDENT=3]trace("on Result " + nsum); // both "trace" return correct values.........[/INDENT]
[INDENT=3]
sumSaleValue = sumSaleValue + nsum;[/INDENT]
[INDENT=3]trace("The very last value " + nsum);
trace("The very last value " + nsum);
trace("on sumSale " + sumSaleValue);
[/INDENT]
[INDENT=3]return nsum;[/INDENT]
[INDENT=2]}
[/INDENT]
[INDENT=2]function onFault(info:Object, token:Object = null):void
{[/INDENT]
[INDENT=3]Alert.show(info.toString());[/INDENT]
[INDENT=2]}
cursor.moveNext() [/INDENT]
[INDENT]} [/INDENT]
[INDENT]return sumSaleValue; or return nsum <-- put breakpoint here
[/INDENT]
}
You see that the breakpoint on the return is hit before the breakpoint in the function.
... View more
01-23-2012
08:17 AM
|
0
|
0
|
1133
|
|
POST
|
The code is running correctly. After the program executes the querytask, it will continue through the rest of the function without waiting for the querytask results to be returned. That will happen only in your "test" function when the listener determines the execution is completed. If you want to do things with "nsum", you'll have to put that code into your "test" function. Take a look in the Query Task samples, like this, as an example.
... View more
01-20-2012
01:06 PM
|
0
|
0
|
1133
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-04-2025 06:39 AM | |
| 1 | 2 weeks ago | |
| 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 |
Wednesday
|