|
POST
|
So is there an easy way to make some dummy or temp feature classes to add to a map? Something I could do locally on the users machine and not in the feature service. i would then add those layers to the map, add the buffer/highlight polygon, color them, and then export. Then i would have to clean them up afterwards. How could I make some temp polygon feature classes like you suggest here.
... View more
10-01-2018
10:45 AM
|
0
|
1
|
3390
|
|
POST
|
I am allowing my users to Export their polygons using a a form in which they select the polygon and hit export. This tool asks if the user would like to highlight the polygon with a certain color, and also buffer that polygon. The tool then exports a pdf layout or shows it on the screen. I have been able to allow for selection, load a saved layout, update the layout tags, move the camera, etc. This all happens in the background. However, when I try to add a selection overlay, or buffer overlay, it doesn't show up on the layout? I know I am adding the disposable overlay to the map, because I am not disposing it yet and I can see it? //This highlights my geometry on my main map
CIMStroke outline = SymbolFactory.Instance.ConstructStroke(CIMColor.CreateRGBColor(0, 0, 0, 50.0), 2.0, SimpleLineStyle.Solid);
CIMRGBColor BlueColor = ColorFactory.Instance.BlueRGB as CIMRGBColor;
IDisposable disposable = MapView.Active.AddOverlay(inItem.Geometry, SymbolFactory.Instance.ConstructPolygonSymbol(BlueColor, SimpleFillStyle.Solid, outline).MakeSymbolReference());
//Get the map frame element of the layout that I use, and replace the map
//This should have the disposable Overlay on it but it doesn't?
Layout layout = LayoutProjectItem.GetLayout();
MapFrame mapFrame = layout.FindElement("MapLayer") as MapFrame;
mapFrame.SetMap(inUserPrintInformation.MapCopy);
// Create PDF format with appropriate settings
PDFFormat PDF = new PDFFormat()
{
Resolution = 300,
OutputFileName = inExportFileName
};
if (PDF.ValidateOutputFilePath())
{
LayoutProjectItem.Export(PDF);
} This code is just a snipped of all of my code, but i essentially want to add a overlay to the map and export it. But it doesn't seem to be on the exported map?
... View more
10-01-2018
06:50 AM
|
0
|
9
|
3558
|
|
POST
|
I am adding overlays to my Feature Service Polygons using a docking tool. So when the Docking tool loads it colors certain polygons with one color and populates others with another color. A grid is used on the Docking tool to show a list of rows, each with their own color. When a user clicks on a row in the dock, and then clicks on the polygon on the map, it shows the polygon as the cooresponding color from the row on the docking tool. This is used to click and change some polygons based on spatially clicking on the map to organize some polygons. When doing this overlay, the labels of the underlying Polygons get (Overlayed) for lack of a better term. I am wondering if there is a way to make the overlay have less of a priority then the label on the underlying polygons? So when an overlay is added to the polygons, the label still shows on top of the overlay. I think I am missing something here?
... View more
09-25-2018
06:35 AM
|
0
|
0
|
554
|
|
POST
|
Did you extend the dictionary or something in order to use .search() on it? I can't get it to work like you have above?
... View more
09-07-2018
01:14 PM
|
0
|
1
|
1707
|
|
POST
|
Has anyone had an issue with a custom pane and the IsVisible attribute. I have a button that launches a dock pane, if that pane is already launched Pane.IsVisible, then it doesn't relaunch it. The pane also has a save button on it, that when clicked, closes the Pane if it is Pane.IsVisible. In 2.2 the IsVisible attribute is always false. Do I need to manage this attribute on my own or has there been a change to the DockPane API.
... View more
09-07-2018
12:24 PM
|
0
|
0
|
370
|
|
POST
|
I am trying to move some of my code from inspector to Row for the purposes of saving in RowCreate and Change Events. Is there a quick way to get a Row from an OID. I think I am missing something. For instance below, I want the first selected item from the selection set, but I get an OID and need to quickly get the ROW for it. I know I can do the lookup and get the row cursor, but is there an easier way than this to get a Row for a OID than GetRowForOID like I have below? Much like the Inspector does? //I need to get what the user, if multiple, i need to get the first public static Task<Row> GetFirstSelectedRow()
{
return QueuedTask.Run(() =>
{
try
{
Row selectedRow = null;
// get the currently selected features in the map
var selectedFeatures = MapView.Active.Map.GetSelection();
if (selectedFeatures.Count > 0)
{
// get the first layer and its corresponding selected feature OIDs
var firstSelectionSet = selectedFeatures.First();
// load the selected features into the inspector using a list of object IDs
if (firstSelectionSet.Value.Count > 0)
{
selectedRow = GetRowForOID(firstSelectionSet.Key as FeatureLayer, firstSelectionSet.Value.First());
}
}
return selectedRow;
}
catch (Exception e)
{
LogWriter.LogError("FeatureServiceManagement - getFirstSelectedItem", e);
return null;
}
});
} public static Row GetRowForOID(FeatureLayer inFeatureLayer, long inOID)
{
try
{
Row ReturnRow = null;
if (inFeatureLayer == null)
{
return null;
}
string OidFieldName = inFeatureLayer.GetTable().GetDefinition().GetObjectIDField();
QueryFilter qf = new QueryFilter()
{
WhereClause = string.Format("{0} = {1}", OidFieldName, inOID)
};
// apply the query filter to the feature layer in question
RowCursor rowCursorSearch = inFeatureLayer.Search(qf);
if (rowCursorSearch != null && rowCursorSearch.MoveNext())
{
if (rowCursorSearch.Current != null)
{
ReturnRow = rowCursorSearch.Current;
}
}
return ReturnRow;
}
catch (Exception e)
{
LogWriter.LogError("FeatureServiceManagement - GetRowForOID", e);
return null;
}
}
... View more
09-07-2018
12:03 PM
|
0
|
4
|
1833
|
|
POST
|
So i should be have been using a rowcursor this whole time and not the inspector. Much like we use to do in arcobjects? I found the inspector very easy to use, and had to use the OID to prevent reentry into the change event, but other than that it worked great. This is triggered when a user creates a feature. Basically I send the inspr to my factory and it does all the work. So I should remove the inspector and switch it to the row? And use store instead of the apply methods on Inspector? protected static async void OnRowCreateEvent(RowChangedEventArgs args)
{
try
{
Inspector inspr = await GetInspectorForRow(args, true);
PMItem pmi = PMFactory.GetPMItem(inspr);
if (pmi != null && Settings.CurrentMapSettings != null)
{
pmi.PlantCode = Settings.CurrentMapSettings.PlantCode;
pmi.HarvestYear = Settings.CurrentMapSettings.HarvestYear;
pmi.HarvestTrimester = Settings.CurrentMapSettings.HarvestTrimester;
pmi.MaterialGroup = Settings.CurrentMapSettings.MaterialGroup;
//Override of Created/Modified
pmi.PMCreatedBy = Settings.CurrentUserName;
pmi.PMModifiedBy = Settings.CurrentUserName;
//Make the initial commit to get the field to be visible with the definition query
await pmi.CommitChangesAsync();
pmi.ShowEditForm = true;
pmi.HasShapeChanged = true;
pmi.IsNew = true;
await pmi.Edit();
}
}
catch (Exception e)
{
LogWriter.LogError("PMBlackModule - onRowCreateEvent", e);
}
}
... View more
09-06-2018
11:06 AM
|
0
|
1
|
1710
|
|
POST
|
I think I have a work around for this issue, but don't understand why I have to do this. The problem with this, is that when .Apply is done to an Inspector that has its shape changed, that change is not happening or saved. Is anyone else experiencing this? Apply and Apply async don't update my inspector shape in the database, it rolls the change back. All other attributes appear to update, but shape rolls back. My workaround is to create a static geometry variable in my module. This Geometry variable needs to be set to a geometry value that you want to change for an inspector somewhere. That way, when on the OnChange event comes in, the arg can set its shape to this value. This is the only way I can get this to work. This has to be a bug of some kind I used to be able to set my geometry for an inspector and call Apply Async _dataInspector.Shape = NewBufferShape;
await _dataInspector.ApplyAsync(); in 2.2 the above won't work any longer, as the Apply on the inspector doesn't appear to save the shape anymore. You can test this by putting breakpoint in the OnChange event of the module and seeing that the area on the arg is not the same as the area on the inspector. You can also change the shape of the inspector, note the shape area, apply changes and check the shape area again right after apply is done. It will have rolled back. So the work around has to be to set up a static variable to set on the module to force the Arg to set the new geometry //Layer object code on how to update
Module.CurrentlyUpdatingGeometry = _dataInspector.Shape;
await _dataInspector.ApplyAsync();
Module.CurrentlyUpdatingGeometry = null;
//Module Code
public static Geometry CurrentlyUpdatingGeometry;
protected static async void OnRowChangeEvent(RowChangedEventArgs args)
{
if (!CurrentlyUpdatingGeometry.IsNullOrEmpty())
{
args.Row["Shape"] = CurrentlyUpdatingGeometry;
}
.
.
.
.
.
}
... View more
09-06-2018
08:21 AM
|
0
|
1
|
1710
|
|
POST
|
I have just confirmed that when I make changes to an inspector and call apply or applyasync, those changes do not come through with the "Args" on the OnRowChangeEvent. Is there some other shape I need to change on the inspector I need to call before I call Apply()? To test this, set up a Row Change on your module. Then from another piece of code, update an inspectors shape to another shape (i am using a feature service). The areas should be different at this point. Note the Area of the shape at this point, then apply() that change. This will then trigger the row change event in the module. In the change event, catch the Arg immediately and look at its shape area value, it should be the same as your inspector, but that shape has reverted back to the shape from before you made the original change. There is something going on here for sure? The inspector shape is not updating or reverting somehow
... View more
09-05-2018
02:12 PM
|
0
|
0
|
1710
|
|
POST
|
I just attempted to remove the edit operation and just use apply on the inspector. This also fails to update the geometry? How do I update the geometry of the inspector? If I catch the Arg in the Row Change Event, after I call Apply, the area value has reverted back to the pre difference value too? //Gets the Difference of this Item minus an input Geometry
public void Difference(Geometry inDifferenceGeometry)
{
LogWriter.Log.Debug(" Item - Difference - Entered");
try
{
//Get the difference of thisItem minus the inDifferenceGeometry
if (!inDifferenceGeometry.IsNullOrEmpty())
{
Geometry originalShape = _dataInspector.Shape;
Geometry differenceShape = GeometryEngine.Instance.Difference(originalShape, inDifferenceGeometry);
_dataInspector.Shape = differenceShape;
if (_dataInspector != null)
{
long currentObjectID = OID;
try
{
ProMapBlackModule.CurrentlyUpdatingOIDList.Add(currentObjectID);
PMModifiedBy = Settings.CurrentUserName;
//AFTER THE APPLY, THE VALUE reverts back to the Original (Pre Difference Area???)
_dataInspector.Apply();
}
catch (Exception e)
{
ProMapBlackLogWriter.LogError("ProMapItem - CommitChanges - " + MemberName, e);
throw;
}
finally
{
ProMapBlackModule.CurrentlyUpdatingOIDList.Remove(currentObjectID);
}
}
}
}
catch (Exception e)
{
LogWriter.LogError(" Item - Difference", e);
}
}
... View more
09-05-2018
01:55 PM
|
0
|
1
|
1710
|
|
POST
|
Above you say "I think I saw your code snippets using an another EditOperation in one of the functions that are instantiated from the row events. In 2.2 this will not work. " This has to be my issue. Within each create or update row event, my object tells itself to clip based on another shape of a certain type. In that clip function is the difference command. That difference command uses the edit operation modify and calls a commit operation to do the execution. The commit operation keeps track of the OID so that the row change isn't fired again. How do I go about switching from the edit operation code below, to committing my geometry changes for my inspector in the row events like you mention. I need my geometry/shape change to be reflected. But I don't see in your example how I can do this? //Gets the Difference of this Item minus an input Geometry
public void Difference(Geometry inDifferenceGeometry)
{
LogWriter.Log.Debug(" Item - Difference - Entered");
try
{
//Get the difference of thisItem minus the inDifferenceGeometry
if (!inDifferenceGeometry.IsNullOrEmpty())
{
Geometry originalShape = _dataInspector.Shape;
Geometry differenceShape = GeometryEngine.Instance.Difference(originalShape, inDifferenceGeometry);
_dataInspector.Shape = differenceShape;
//create and execute the edit operation
// create an edit operation
EditOperation differenceOperation = new EditOperation(){
Name = "Difference Operation",
ProgressMessage = "Working...",
CancelMessage = "Operation canceled.",
ErrorMessage = "Error In Difference",
SelectModifiedFeatures = false,
SelectNewFeatures = false
};
differenceOperation.Modify(_dataInspector);
CommitEditOperation(differenceOperation);
}
}
catch (Exception e)
{
LogWriter.LogError(" Item - Difference", e);
}
}
public void CommitEditOperation(EditOperation eo)
{
long currentObjectID = OID;
try
{
PMModifiedBy = Settings.CurrentUserName;
Module.CurrentlyUpdatingOIDList.Add(currentObjectID);
LogWriter.Log.Debug(" Item - CommitEditOperation - Started " + eo.Name);
//AT THIS POINT MY SHAPE IS THE CORRECT NEW ARE, BUT THE Execute() CHANGES THAT back to the original shape
bool operationResult = eo.Execute();
LogWriter.Log.Debug(" Item - CommitEditOperation - Finished " + eo.Name);
}
catch (Exception e)
{
LogWriter.LogError(" Item - CommitEditOperation - " + eo.Name, e);
throw;
}
finally
{
Module.CurrentlyUpdatingOIDList.Remove(currentObjectID);
}
}
... View more
09-05-2018
01:21 PM
|
0
|
2
|
1710
|
|
POST
|
When will 2.3 be released. I would like to get my users on the latest version, as they are still on 2.1.2. But if you are planning a new release soon, i might wait.
... View more
09-05-2018
10:39 AM
|
0
|
1
|
738
|
|
POST
|
We have one user that is unable to add a feature service connection in Both ArcGIS Pro and ArcMap. This user IS able to put the Feature Service URL in Chrome and get to the Feature Service successfully, but is unable to connect via the desktop applications and creating a New ArcGIS Server Connection. Our users on our network require not credentials and this has worked for hundreds of other users. Our network and windows personal are unable to find an issue with this user. In ArcMap the user receives an error about proxy server got bad address from remote server. ArcGIS Pro times out or is saying that the Server took too long to answer (Status Code 28). We have tried reinstaling Pro, but didn't work either. Any suggestions or reasoning behind the URL working in Chrome and not the Thick clients
... View more
08-23-2018
06:49 AM
|
1
|
1
|
2272
|
|
POST
|
I was able to just add some analysis tabs that I wanted and the crashing went away. I remove the analysis and view tab using this code inserted into my above logic. if (id == null || id.Value.StartsWith("esri_layouts"))
{
//We don't want to see the analysis or view tab
if (!id.Value.Contains("esri_layouts_analysisTab") && !id.Value.Contains("esri_layouts_viewTab"))
{
continue; //Skip all Layout but analysis and view
}
}
... View more
08-22-2018
09:47 AM
|
0
|
0
|
653
|
|
POST
|
I have a custom application in which i remove all tools and tabs except for my tools located in my config.daml using this code in the ConfigurationManager. All of my tools are used on the Map Tab. protected override void OnUpdateDatabase(XDocument database)
{
var nsp = database.Root.Name.Namespace;
// select all elements that are tabs
var tabElements = from seg in database.Root.Descendants(nsp + "tab") select seg;
// collect all elements that need to be removed
var elements = new HashSet<XElement>();
foreach (var tabElement in tabElements)
{
// skip root and backstage elements
if (tabElement.Parent == null || tabElement.Parent.Name.LocalName.StartsWith("backstage"))
continue;
var id = tabElement.Attribute("id");
if (id == null || id.Value.StartsWith("MYIDS"))
{
continue;//Skip our tabs
}
elements.Add(tabElement);
}
// remove the elements
foreach (var element in elements)
{
element.Remove();
}
} I think this might be an easy one, but I need to figure out why my application crashes when I load a layout from the code behind. This opens a layout tab. But when I click on one layout element (Text Element). The config application crashes with the following errors. My guess is this must have something to do with, when clicking on the Text Element in the layout tab, no menu exists for that Text Element? I think I need to add back in the layout menus and Tabs. But I really want my uses to only be able to use tools that I show in my configuration. System.InvalidOperationException
HResult=0x80131509
Message=Sequence contains no matching element
Source=System.Core
StackTrace:
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
at ArcGIS.Desktop.Framework.TabManager.UpdateTabGroupCaption(String id, String newCaption)
at ArcGIS.Desktop.Layouts.Element.ActivateSelectedElementTab()
at ArcGIS.Desktop.Layouts.Layout.<>c__DisplayClass171_0.<UpdateGUISelectionAsync>b__0()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at main(String[] args)
... View more
08-22-2018
09:34 AM
|
0
|
1
|
701
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-23-2018 06:49 AM | |
| 1 | 08-02-2023 08:28 AM | |
| 1 | 01-03-2020 10:54 AM | |
| 1 | 11-30-2017 06:41 AM | |
| 1 | 08-20-2018 01:10 PM |
| Online Status |
Offline
|
| Date Last Visited |
01-27-2026
08:03 AM
|