|
POST
|
I think you've experienced one of the many ArcGIS Pro failings. See this ArcGIS Idea.
... View more
09-28-2017
08:38 AM
|
3
|
2
|
5610
|
|
POST
|
Hah. Spoke too soon. Looks like I kind of have a Dot Net version of the VBA code. I frankly don't know if this works. I think it does but it's been years since I used it. Looks like this updated code only changes the color TO green in this example but you get the idea: Imports ESRI.ArcGIS.ArcMapUI Imports ESRI.ArcGIS.Carto Imports ESRI.ArcGIS.Display Public Class cmdMakeLabelGreen Inherits ESRI.ArcGIS.Desktop.AddIns.Button Public Sub New() End Sub Protected Overrides Sub OnClick() Dim application As ESRI.ArcGIS.Framework.IApplication = Nothing Dim pIMxDoc As IMxDocument Dim pMap As IMap Dim pActiveView As IActiveView Dim pGraphSel As IGraphicsContainerSelect Dim numSel As Integer Dim pDisplay As IDisplay Dim pContainer As IGraphicsContainer Dim pSymbol As ITextSymbol Dim myColor As IRgbColor Dim whiteFill As IRgbColor Dim pTextElement As ITextElement Dim pCallout As IBalloonCallout Dim pFillSymbol As IFillSymbol Dim pLineSymbol As ILineSymbol Dim pTextBackground As ITextBackground Dim pTextSymbol As IFormattedTextSymbol Try application = My.ArcMap.Application Dim document As ESRI.ArcGIS.Framework.IDocument = application.Document 'pMxDoc = application.Document pIMxDoc = CType(document, ESRI.ArcGIS.ArcMapUI.IMxDocument) pActiveView = pIMxDoc.FocusMap pDisplay = pActiveView.ScreenDisplay pMap = pIMxDoc.FocusMap pContainer = pIMxDoc.FocusMap pGraphSel = pContainer '-------------------------------------------------------------------------- 'Make sure only one label is selected. Adjust as desired.. '-------------------------------------------------------------------------- numSel = pGraphSel.ElementSelectionCount Select Case numSel Case 0 MsgBox("You must select a label!", vbExclamation, "Error Encountered") Exit Sub Case 1 'Do Nothing Case Else MsgBox("You must have one label selected!", vbExclamation, "Error Encountered") Exit Sub End Select Dim index As Integer Dim pElement As IElement For index = 0 To numSel - 1 pElement = pGraphSel.SelectedElement(index) If TypeOf pElement Is ITextElement Then pTextElement = pGraphSel.SelectedElement(index) pSymbol = pTextElement.Symbol myColor = pSymbol.Color 'Road is changing from closed to OPEN myColor.Red = 38 myColor.Green = 115 myColor.Blue = 0 pSymbol.Color = myColor whiteFill = New RgbColor whiteFill.Red = 255 whiteFill.Green = 255 whiteFill.Blue = 255 pLineSymbol = New SimpleLineSymbol pFillSymbol = New SimpleFillSymbol pLineSymbol.Color = myColor pLineSymbol.Width = 1 pFillSymbol.Color = whiteFill pFillSymbol.Outline = pLineSymbol pTextElement.Symbol = pSymbol pElement = pTextElement pTextSymbol = pTextElement.Symbol pTextBackground = pTextSymbol.Background pCallout = pTextBackground pCallout.Symbol = pFillSymbol '.Outline.Color = myColor pTextSymbol.Background = pCallout pTextElement.Symbol = pTextSymbol pElement = pTextElement pContainer.UpdateElement(pElement) End If Next index pActiveView.PartialRefresh(ESRI.ArcGIS.Carto.esriViewDrawPhase.esriViewGeography, Nothing, Nothing) '---------------------------------------------------------------------- 'Release any memory allocated '---------------------------------------------------------------------- pElement = Nothing pTextElement = Nothing pLineSymbol = Nothing pFillSymbol = Nothing pTextSymbol = Nothing pActiveView = Nothing whiteFill = Nothing pSymbol = Nothing myColor = Nothing pGraphSel = Nothing pContainer = Nothing pMap = Nothing pDisplay = Nothing pIMxDoc = Nothing pTextBackground = Nothing Catch ex As Exception globalErrorHandler(ex) End Try End Sub Protected Overrides Sub OnUpdate() End Sub End Class
... View more
09-22-2017
09:54 AM
|
1
|
0
|
1695
|
|
POST
|
You certainly should be able to do this with ArcObjects. I did something kinda similar about 10 years ago using ArcObjects and VBA. I developed some internal tools to help automate and speed up mapping emergency road closures & one map product used balloon callouts that were symbolized either green (re-opened) or red (closed). Rather than drill down 12 levels in the symbol properties, I used VBA ArcObjects to quickly "flip" the color for the selected callout. Screenshot: And here's the VBA code: Private Sub ToggleLabelColor_Click() '========================================================================== 'This subroutine adds a one point white halo to the currently selected label '========================================================================== Dim pIMxDoc As IMxDocument Dim pMap As IMap Dim pActiveView As IActiveView Dim pGraphSel As IGraphicsContainerSelect Dim numSel As Integer Dim pEnv As IEnvelope Dim pDisplay As IDisplay Dim pContainer As IGraphicsContainer Dim pSymbol As ITextSymbol Dim myColor As IRgbColor Dim whiteFill As IRgbColor Dim pTextElement As ITextElement Dim pCallout As IBalloonCallout Dim pFillSymbol As IFillSymbol Dim pLineSymbol As ILineSymbol Dim pTextBackground As ITextBackground Dim pTextSymbol As IFormattedTextSymbol Set pIMxDoc = ThisDocument Set pActiveView = pIMxDoc.FocusMap Set pDisplay = pActiveView.ScreenDisplay Set pMap = pIMxDoc.FocusMap Set pContainer = pIMxDoc.FocusMap Set pGraphSel = pContainer '-------------------------------------------------------------------------- 'Make sure only one label is selected. Adjust as desired.. '-------------------------------------------------------------------------- numSel = pGraphSel.ElementSelectionCount Dim index As Integer Dim pElement As IElement Dim haloSize As Double For index = 0 To numSel - 1 Set pElement = pGraphSel.SelectedElement(index) If TypeOf pElement Is ITextElement Then Set pTextElement = pGraphSel.SelectedElement(index) Set pSymbol = pTextElement.Symbol Set myColor = pSymbol.Color If myColor.Red = 255 Then 'Road is changing from closed to OPEN myColor.Red = 38 myColor.Green = 115 myColor.Blue = 0 'MsgBox "This road is closed!", vbInformation, "Results" Else 'Road is changing from open to CLOSED myColor.Red = 255 myColor.Green = 0 myColor.Blue = 0 'MsgBox "This road is open!", vbInformation, "Results" End If pSymbol.Color = myColor Set whiteFill = New RgbColor whiteFill.Red = 255 whiteFill.Green = 255 whiteFill.Blue = 255 Set pLineSymbol = New SimpleLineSymbol Set pFillSymbol = New SimpleFillSymbol pLineSymbol.Color = myColor pLineSymbol.Width = 1 pFillSymbol.Color = whiteFill pFillSymbol.Outline = pLineSymbol pTextElement.Symbol = pSymbol Set pElement = pTextElement Set pTextSymbol = pTextElement.Symbol Set pTextBackground = pTextSymbol.Background Set pCallout = pTextBackground Set pCallout.Symbol = pFillSymbol '.Outline.Color = myColor Set pTextSymbol.Background = pCallout pTextElement.Symbol = pTextSymbol Set pElement = pTextElement End If Next index pActiveView.PartialRefresh esriViewGraphics, Nothing, Nothing '---------------------------------------------------------------------- 'Release any memory allocated '---------------------------------------------------------------------- Set pElement = Nothing Set pTextElement = Nothing End Sub Private Function ToggleLabelColor_Message() As String ToggleLabelColor_Message = "Toggles the Road Closure Balloon Callout Color Between Red (Closed) and Green (open)" End Function Private Function ToggleLabelColor_ToolTip() As String ToggleLabelColor_ToolTip = "Toggle Closure Callout Color" End Function In the example above, I'm working with graphic labels within an MXD but I think the principle is the same in terms of accessing the symbol properties for a callout. Sorry I don't have a Dot Net version of this code since we moved away from producing the PDF map based updates during events. Steve
... View more
09-22-2017
09:47 AM
|
1
|
1
|
1695
|
|
POST
|
I'd suggest looking at what NAPSG has put together.
... View more
09-13-2017
11:00 AM
|
0
|
0
|
2999
|
|
POST
|
Yeah, personal GeoDBs aren't a BIG deal to me since they can be converted to File GeoDBs. Still, I may have a couple floating around that I haven't converted. Anyways, several of the others I listed are larger deal killers. As for the Creative Cloud alternative, I think there's already some sort of limitation with that option (doesn't work with local layers? or something like that). I'm frankly tired of ESRI's continual pattern of suggesting fundamental workflow changes because they can't be bothered with keeping existing functionality (CTRL-V, Calculate Geometry, etc).
... View more
09-12-2017
11:32 AM
|
2
|
1
|
3211
|
|
POST
|
I've started a running list of things Pro can't do that Arcmap can. Among the features that didn't migrate from Arcmap to Pro that I use: Show vertices during editing using the V key. Export to Illustrator format. Create folder connection to root level of drive Move callout leader line anchor point independently of the entire callout. Open program without having to create a project. Pausing drawing. Support personal GeoDbs. Calculate geometry as right-click option in table view. Summary Statistics (right-click in Arcmap style). Can't copy/paste features Can't clip map data frame to a shape Until then, hard pass. Steve
... View more
09-11-2017
03:32 PM
|
3
|
7
|
3211
|
|
POST
|
Thanks for the additional suggestions, gents. As it turns out, I may have found the culprit- SDE. The feature class in SDE had versioning enabled. This was not the case when I originally loaded the dataset into SDE. Once I "un-versioned" the feature class, I was able to delete and save edits in a more prompt manner. I've re-enabled the map service and I'm waiting to see if my co-workers are still having issues.
... View more
08-31-2017
10:09 AM
|
0
|
0
|
2259
|
|
POST
|
UPDATE: singleClusterMode is set to TRUE. Also tried adding a feature straight from the REST addFeatures operation and it eventually returned: { "error": { "code": 500, "message": "Error performing add features operation", "details": [] } }
... View more
08-30-2017
12:35 PM
|
0
|
1
|
2259
|
|
POST
|
Micah, No complex lines- just two vertices as a test. No- I haven't tried adding a feature via the REST interface Service timeouts are: 60s for use; 60s for waiting to get a service; 300s for idle services. # instances are 1/2 (min/max) I'm able to add a feature to the SDE feature class from within ArcGIS Desktop. Not sure about adding to the feature service from desktop, though. I connected to the service via the GIS Server option but it said no services were editable. Maybe I was just looking at the map service instead of the feature service?.. We are using the ArcGIS Web Adaptor so no 3rd party load balancers Not sure about the single cluster mode. I'm not the AGS admin so I don't know all the details about how our install was/is set up. I should note that the test feature I successfully added via desktop Arcmap showed up in the web service but I was unable to delete from within my web map (that apply edits method timed out just like adding a new feature).
... View more
08-30-2017
12:20 PM
|
0
|
0
|
2259
|
|
POST
|
Having a weird situation with an internal app I developed using the JS API (currently pointing to v3.17). Anyways, our ArcGIS Server was at 10.2x and was recently upgraded to 10.41. Around that time, the ability of users to add new lines to a service enabled with feature access has failed. The underlying JS code has not changed at all. Adding a point feature still works but, when attempting to commit a polyline, no error shows in the browser console but the Server log returns this: The point feature service was published together with the line feature service and hasn't changed. Since the service hasn't changed, and the code of the application hasn't either, where should I start looking to determine why this is suddenly happening? Steve
... View more
08-30-2017
11:31 AM
|
0
|
6
|
2448
|
|
POST
|
No- I'm afraid I have not. I have manually created a KML file of circles via JS (using the HTML5 file object) but that's about it. I originally wanted to create this using the JS API but ESRI didn't provide a worldwide free elevation query service so I opted for Google's map API instead. Anyways, the KML construction part should be JS API independent. Don't know if this will actually be useful for you but here's the link. Essentially, zoom in someplace, click a location, provide a file name, and click the Make KML button. The browser should prompt you to either open a KML or save it locally.
... View more
08-28-2017
10:18 AM
|
0
|
0
|
5005
|
|
POST
|
A less intense option might be to convert the JSON to KML.
... View more
08-28-2017
09:03 AM
|
1
|
4
|
5005
|
|
POST
|
Awesome. Great to know that it is possible. Thanks for the sample. It seems a little awkward to implement but I think I have an idea of how to do it. Thanks again!
... View more
08-16-2017
09:55 AM
|
0
|
0
|
2254
|
|
POST
|
I have 3.x based app that allows my users to add features to a layer via the editing functionality and everything works great. One comment has come back to me about the possibility of creating one feature that represents multiple locations. In the desktop world, that would be a multipart feature: I tried searching here for multipart but editing didn't come up. There are some addPath & removePath methods for polylines but that's all I've seen. Long story short- is it possible to create one feature that has multiple parts like my screenshot above? Are there any code examples about how to do that? Thanks! Steve
... View more
08-15-2017
02:04 PM
|
0
|
3
|
3141
|
|
POST
|
From what you've revealed, I think you're concerned with code related to a specifc DIJIT you're building but my solution lives at a much higher / overall level within an application. As a VERY simplistic example, consider this ESRI sample code: <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<title>Simple Map</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.21/esri/css/esri.css">
<style>
html, body, #map {
height: 100%;
margin: 0;
padding: 0;
}
</style>
<script src="https://js.arcgis.com/3.21/"></script>
<script>
var map;
var app = {};
require(["esri/map", "dojo/domReady!"], function(Map) {
map = new Map("map", {
basemap: "topo", //For full list of pre-defined basemaps, navigate to http://arcg.is/1JVo6Wd
center: [-122.45, 37.75], // longitude, latitude
zoom: 13
});
});
</script>
</head>
<body>
<div id="map"></div>
</body>
</html> The declaration of the app object/collection is one of the first things that occurs within JS. That's what makes it truly global and accessible at any level within your application (even down within the code for your DIJIT). Using "this" only brings you up one coding level which would still be within the context of your DIJIT's JS code. At runtime, your browser wouldn't recognize app as a global variable.
... View more
08-08-2017
04:11 PM
|
0
|
1
|
3142
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 1 | 2 weeks ago | |
| 1 | 3 weeks ago | |
| 2 | 3 weeks ago | |
| 1 | a month ago |