|
POST
|
yes, I think you are on the right track. Look at AngleToLine in your code. If true then the marker will follow the direction of the line (this is the default). If false then the marker is placed perpendicular to the line. scratch that, that's not accurate. false just means that the marker orientation is not affected by the line slope. I think you have to design your marker symbol with a rotation on its symbol layers such that, when angletoline=true, it appears perpendicular to the line.
... View more
10-19-2021
09:15 AM
|
0
|
2
|
2180
|
|
POST
|
>>> is there a way to get the list of templates by layer via the code ? https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Editing#edit-templates
... View more
10-06-2021
09:31 AM
|
0
|
0
|
720
|
|
POST
|
This is a checklist of sorts: https://github.com/Esri/arcgis-pro-sdk/wiki/ProGuide-Diagnosing-ArcGIS-Pro-Add-ins
... View more
10-06-2021
08:20 AM
|
0
|
0
|
830
|
|
POST
|
try locking. assuming autocad is not spinning up multiple instances then_ private static object readonly _lock = new object();
public void Execute()
{
Host.Initialize();
lock(_lock) {
var scp = new ServiceConnectionProperties(new Uri("https://myportal.mydomain.com/arcgis/rest/services/UN/Water_Distribution_Utility_Network/FeatureServer"));
var gdb = new Geodatabase(scp);
if (gdb.IsVersioningSupported())
{
var versionm = gdb.GetVersionManager();
var versions = versionm.GetVersionNames().OrderBy(p => p).ToList();
}
}
} if the lock resolves the issue u can remove methods from the scope of the lock until it doesnt work again - at that point u will have found the minimum required scope of the lock. Note: if autocad _is_ spinning up multiple instances u may need a mutex instead.
... View more
09-24-2021
01:06 PM
|
0
|
0
|
3400
|
|
POST
|
System.Globalization.CultureInfo.CurrentUICulture would probably be preferred
... View more
09-24-2021
12:57 PM
|
1
|
0
|
1794
|
|
POST
|
Prashant, looks like it is a bug. We will try and get this fixed in 2.9. Meanwhile, please try the following workaround (which sets the underlying FeatureCacheType manually): internal class DisplayCache : Button
{
protected async override void OnClick()
{
var fl = MapView.Active.Map.GetLayersAsFlattenedList()
.OfType<FeatureLayer>().FirstOrDefault();
if (fl == null)
return;
await QueuedTask.Run(() =>
{
if (fl.GetIsFeatureServiceLayer())
{
var def = fl.GetDefinition() as CIMFeatureLayer;
def.DisplayCacheType = DisplayCacheType.None;
def.FeatureCacheType = FeatureCacheType.None;
fl.SetDefinition(def);
}
});
}
}
internal static class FeatureServiceLayerExtensions
{
public static bool GetIsFeatureServiceLayer(this FeatureLayer flayer)
{
if (flayer.ConnectionStatus == ConnectionStatus.Broken)
return false;
GeodatabaseType gdbType = GeodatabaseType.FileSystem;
using (var dataset = flayer.GetTable())
{
using (var gdb = dataset.GetDatastore())
{
//Note shapefile will be "FileSystemDatastore"
if (gdb is Geodatabase)
{
gdbType = ((Geodatabase)gdb).GetGeodatabaseType();
}
}
}
return gdbType == GeodatabaseType.Service;
}
}
... View more
09-13-2021
06:13 PM
|
0
|
0
|
2245
|
|
POST
|
check out this sample: https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Map-Exploration/WorkingWithQueryDefinitionFilters it shows usage of multiple query defs.
... View more
09-13-2021
03:00 PM
|
0
|
0
|
1660
|
|
POST
|
Try using a LayerDocument instead. This snippet shows the workflow to follow: apply-symbology-to-a-layer-from-a-layer-file . Some more information can be found here: ProConcepts-Map-Authoring#layer-files-and-layer-packages
... View more
08-16-2021
09:33 AM
|
1
|
0
|
3345
|
|
POST
|
The problem is most likely your function signature: private async void CreateMaps(....) It is marked "async" but returns void. Instead, change it to: private async Task CreateMaps(...) and u shld get the behavior u are expecting. Notice it now returns _Task_. I would recommend the following articles and resources to help u on async/await and asynchronous programming in general and they will also help explain the difference between the two method signatures above (and why return Task): ProConcepts-Framework#working-with-multithreading-in-arcgis-pro ProConcepts-Asynchronous-Programming-in-ArcGIS-Pro We also have some videos online: Pro SDK Video Playlists - You might find our intro course helpful: ArcGIS Pro SDK for .NET: Beginning Pro Customization with focus on DAML and Customization Patterns - minute mark 46.23. This particular one was from 2019. Also ArcGIS Pro SDK for .NET: Synchronous and Asynchronous Custom Method Design from 2021. Last, I would also recommend restructuring your method internals to be something like as follows. You will also find this explained in the above resources: private Task<List<Map>> CreateMapsAsync(string[] variables, string[] rcps, string[] periods, Boolean UseSDE, string region, string region_sd)
{
return QueuedTask.Run(() => CreateMaps(variables, rcps, periods, UseSDE, region, region_sd));
}
private List<Map> CreateMaps(string[] variables, string[] rcps, string[] periods, Boolean UseSDE, string region, string region_sd)
{
//< declarations >
//...
List<Map> maps = new List<Map>();
var sr2193 = SpatialReferenceBuilder.CreateSpatialReference(2193);
foreach (string map in Mapname_Series)
{
//Create the maps
var newMap = MapFactory.Instance.CreateMap(map, MapType.Map, MapViewingMode.Map, Basemap.None);
newMap.SetSpatialReference(sr2193);
//... < goes on to add data to each map >
maps.Add(newMap);
}
return maps;
}
//USAGE:
//var maps = await CreateMapsAsync(...)
//or use the synchronous version if u are already within another QueuedTask
//var maps = CreateMaps(....)
... View more
08-13-2021
08:15 AM
|
1
|
0
|
1593
|
|
POST
|
No, not if u did not initiate the save. In you particular workflow it looks like a separate commit will be required (for the audits). In general, any event that provides you with an (event args with an) "Operation", allows u to enlist in that ongoing transaction. Off the top of my head I think that's the EditCompleting, Started, and Row events. In all those cases u have access to the EditOperation "in play" - whether u initiated that operation or not.
... View more
08-12-2021
08:19 AM
|
0
|
0
|
3208
|
|
POST
|
I am assuming u are referring to this setting.... which I am not personally familiar with but...if that _is_ the property u are interested in, with a bit of trial and error, it turns out it is this guy here: CIMLegendItem.AutoVisibility This snippet toggles that AutoVisibility for all legend items. I noticed that the legend item property UI did not automatically refresh to reflect the "toggled" value but that is a bug (and I will relay that to the layout team). To update the UI I had to click on the legend and then back on the legend item. internal class ToggleAutoVisibility : Button
{
protected override void OnClick()
{
var lyt = LayoutView.Active?.Layout;
if (lyt == null)
return;
QueuedTask.Run(() =>
{
var def = lyt.GetDefinition();
var legend = def.Elements.OfType<CIMLegend>().FirstOrDefault();
if (legend != null)
{
//toggle auto visibility of all the legend items
foreach(var leg_item in legend.Items)
{
leg_item.AutoVisibility = !leg_item.AutoVisibility;
}
//commit the change
lyt.SetDefinition(def);
}
});
}
}
... View more
08-11-2021
10:59 AM
|
1
|
0
|
3118
|
|
POST
|
>>>The problem we're facing is that apparently there are no events to subscribe to for when edits are saved.<<<< you might find this useful: https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Editing#editcompletedevent specifically an args.CompletedType == EditCompletedType.Save
... View more
08-11-2021
10:28 AM
|
1
|
1
|
3228
|
|
POST
|
I'll take a look and get back to you - but - FYI, there is no such thing as a private state or condition....if u did not "see" a state or condition being set then that probably means that there isn't one.
... View more
07-20-2021
04:03 PM
|
0
|
0
|
2222
|
|
POST
|
it appears that that menu is off the user control itself and not from daml so it cannot be customized
... View more
06-25-2021
10:08 AM
|
1
|
0
|
1849
|
|
POST
|
We do not have support for this directly in the public API and, as a minimum, I think we can add enabling/disabling symbol layer drawing, SLD, to the public API at 2.9. _Configuring_ drawing order by symbol layer is not trivial and is not something that really should be attempted via the public API and the CIM - though it is possible - the code would be very brittle. Any change to the symbology, eg changing a feature symbol definition or altering a unique value class, for example, could break any add-in code that was making assumptions about the structure of a given layer's symbology and renderer. I recommend that you continue to configure the SLD order using the UI and when you have the symbology configured to your liking, save the layer out as a layer file (.lyrx). It is a straightforward process to read the layer file via the API and apply the renderer with the correct SLD defined to an existing layer of the same schema - ProSnippet: Apply Symbology to a layer from a Layer file, - or to simply create a new layer based off the layer file - ProSnippet: Create layer from a lyrx file Meanwhile, in lieu of having a dedicated public API method to enable/disable SLD, assuming that you do have a layer with symbol layer drawing configured (eg using one of the two techniques I mentioned above) - you can enable/disable it using the following code below: In my example, I am toggling SLD on/off for a feature layer called "rivers". However, in my testing of this code, even though SLD was being toggled on the layer, the symbology UI did _not_ update the "Enable symbol layer drawing" check box on the SLD pane. So we have a bug in Pro there that we also need to address. Please be aware of that. I am using Pro version 2.8. protected override void OnClick()
{
var rivers = MapView.Active.Map.GetLayersAsFlattenedList()
.OfType<FeatureLayer>().FirstOrDefault(l => l.Name == "rivers");
if (rivers == null)
return;
QueuedTask.Run(() =>
{
var def = rivers.GetDefinition() as CIMFeatureLayer;
//def.SymbolLayerDrawing will be null if symbol layer drawing has not
//previously been configured
if (def.SymbolLayerDrawing != null)
{
//toggle symbol layer drawing on/off
//TODO: Bug in UI. "Enable symbol layer drawing" checkbox does not update
def.SymbolLayerDrawing.UseSymbolLayerDrawing = !def.SymbolLayerDrawing.UseSymbolLayerDrawing;
rivers.SetDefinition(def);//commit
}
});
} :
... View more
06-24-2021
12:12 PM
|
1
|
1
|
3481
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-19-2026 10:29 AM | |
| 1 | 04-29-2026 02:06 PM | |
| 1 | 01-08-2026 02:03 PM | |
| 1 | 01-08-2026 02:15 PM | |
| 3 | 12-17-2025 11:33 AM |
| Online Status |
Offline
|
| Date Last Visited |
a month ago
|