|
POST
|
The current documentation is for Pro 3.0 or better. I think ArcGISPro.dll was added at 3.0. Try referencing ArcGISPro.exe instead. Note: to get to previous copies u can click on the revisions link at the top of the page (I think the images might still show the current ones fyi)
... View more
03-30-2023
01:23 PM
|
0
|
0
|
869
|
|
POST
|
you could certainly do it but, with what little I know of the metadata editor sdk, i think it would go against the intent of the toolkit tho...which is to kind of consolidate all the metadata property pages and so forth for a new profile in a separate addin. At the end of the day, though, it is just an addin. I took a quick look at the Config.daml file on the metadata github repo and it all looks pretty much dedicated to updating the various metadata categories with the custom metadata property pages, etc. The easiest thing may be to move your other addin content _in to_ your metadata toolkit addin (rather than the other way around). I'd suggest running some of the Pro SDK item templates to add a button, tool, dockpane, and so forth to see where the DAML entries those templates generate go (in the Config.daml). That will show u where u need to stick your addin content if u do bring other content over (from another addin). Currently, the `<insertModule ...` tag of the toolkit config looks empty so new controls, etc. arent going to conflict with anything that I can see. U might need to add `<tabs></tabs>`, `<groups></groups>` and `<controls></controls>` sections into the insertModule tag by hand if the templates dont generate those auto-magically.... like so (see below).....but just run, say, the button template first and see if it does it for u. <insertModule id="Acme_MD_Toolkit_Module" className="MetadataToolkitModule" autoLoad="false" caption="Metadata Toolkit Module">
<tabs></tabs>
<groups></groups>
<controls></controls>
</insertModule>
... View more
03-22-2023
12:23 PM
|
1
|
1
|
1554
|
|
POST
|
hi ruben, so i did get a chance to take a look at the grid style and turns out it is quite complicated. More complicated than I realized. I also ran into one snag that I could not work around - the dependence of the graticule on an internal class: namely property CIMGraticule.GeographicCoordinateSystem is of type ArcGIS.Core.Internal.CIM.GeographicCoordinateSystem Anyway, I did promise an example so I did put an example together however it uses an internal namespace which is unsupported. anyway, you are welcome to fiddle with this code. It makes the following assumptions: The style item is a CIMGraticule The layout page units are in inches. If you have metric units for the page then there would be extra work in converting the graticule grid line length and offset measurements (which, by default, are in inches) to the units of the layout page. Note: There is also a check for a 2D map associated with the map frame in the example. Graticules can only be applied to map frames with 2D maps. This check is _required_. Finally, current plan is still for the capability to apply a grid style to a map frame be added to the layout public api at 3.2. var stylePrjItm = Project.Current.GetItems<StyleProjectItem>()
.FirstOrDefault(item => item.Name == "ArcGIS 2D");
var m_frame = LayoutView.Active?.Layout?.GetElementsAsFlattenedList()
.OfType<MapFrame>()?.FirstOrDefault();
if (m_frame == null)
return;
//valid 2D maps only
if (m_frame.Map == null ||
m_frame.Map.DefaultViewingMode != MapViewingMode.Map)
return;
QueuedTask.Run(() => {
//experiment with a graticule
var grid_si = stylePrjItm.SearchGrids(
"Blue Vertical Label Graticule").FirstOrDefault();
if (grid_si == null)
return;
var grid = grid_si.GetObject() as CIMGraticule;
//Note: Grids can also be CIMMeasureGrid, CIMReferenceGrid, and
//CIMCustomGrid
//unsupported
var xml = m_frame.Map.SpatialReference.Gcs.ToXml();
var gcs = ArcGIS.Core.Internal.CIM.XmlUtil.DeserializeXML<
ArcGIS.Core.Internal.CIM.GeographicCoordinateSystem>(xml);
grid.GeographicCoordinateSystem = gcs;
//assign grid to the frame
var cmf = m_frame.GetDefinition() as CIMMapFrame;
//note, if page units are _not_ inches then grid's gridline
//lengths and offsets would need to be converted to the page units
var mapGrids = new List<CIMMapGrid>();
if (cmf.Grids != null)
mapGrids.AddRange(cmf.Grids);
mapGrids.Add(grid);
cmf.Grids = mapGrids.ToArray();
m_frame.SetDefinition(cmf);
});
... View more
03-16-2023
03:12 PM
|
0
|
1
|
4628
|
|
POST
|
Layout uses TableFrames. That's the closest equivalent. TableFrames, tho' are tied to layers I believe - not free-form text.
... View more
03-14-2023
09:23 AM
|
0
|
0
|
846
|
|
POST
|
here's an example of a custom page for feature layers: - assuming u have added a property sheet/page to your addin (eg using the item template). The key is updating the desired property sheet collection. In this case, I am updating "esri_mapping_featureLayerPropertySheet" which is the collection for feature layers. Config.daml (note: by default the template uses "<page..." - note that for "<udpdateSheet" u need to use "<insertPage ..." <propertySheets>
<updateSheet refID="esri_mapping_featureLayerPropertySheet">
<insertPage id="LayerPropertyPageExample_Pages_FeatureLayerCustomPage"
caption="Custom Page" className="LayerPropertyPageExample.Pages.FeatureLayerCustomPageViewModel"
group="Custom Group">
<content className="LayerPropertyPageExample.Pages.FeatureLayerCustomPageView" />
</insertPage>
</updateSheet>
</propertySheets> Module1.cs internal class Module1 : Module {
...
protected override bool Initialize() {
if (MapView.Active != null) {
var layers = MapView.Active?.GetSelectedLayers().OfType<FeatureLayer>();
if (layers?.Count() > 0) {
var json_settings = new JsonSerializationSettings() {
PrettyPrint = true
};
QueuedTask.Run(() => LayerJSON = layers.First()
.GetDefinition().ToJson(json_settings));
}
}
ArcGIS.Desktop.Mapping.Events.TOCSelectionChangedEvent
.Subscribe(async (args) => {
var layers = args.MapView?.GetSelectedLayers().OfType<FeatureLayer>();
if (layers?.Count() > 0) {
var json_settings = new JsonSerializationSettings() {
PrettyPrint = true
};
LayerJSON = await QueuedTask.Run(() =>
layers.First().GetDefinition().ToJson(json_settings));
}
});
return true;
}
private string _layerJSON = "";
public string LayerJSON {
get {
return _layerJSON;
}
set {
_layerJSON = value;
}
} Property page View Model and View: internal class FeatureLayerCustomPageViewModel : Page {
...
public string LayerJSON => Module1.Current.LayerJSON;
} <UserControl x:Class="LayerPropertyPageExample.Pages.FeatureLayerCustomPageView">
...
<Grid>
<Border BorderThickness="1" Padding="1">
<Border.BorderBrush>
<SolidColorBrush Color="{DynamicResource Esri_Color_Blue}"></SolidColorBrush>
</Border.BorderBrush>
<ScrollViewer HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto">
<TextBlock Text="{Binding LayerJSON}"
TextWrapping="Wrap"/>
</ScrollViewer>
</Border>
</Grid>
</UserControl> .
... View more
03-14-2023
09:18 AM
|
1
|
0
|
933
|
|
POST
|
We are adding the capability to apply a grid style to a mapframe to the Layout api at 3.2. The (target) frame must have a valid 2D map. If u have the graticules/grid style item already defined in a style item that would be the most straightforward to apply (rather than trying to build it from scratch in code which is not practical given the v large number of properties that would need defaults). Applying a style to the map frame will involve using the CIM definition of the map frame. as currently I am in Palm Springs for the DEV Summit so i can take a look at this further next week when Im back (in the office). Meanwhile, If u r not familiar with the CIM then u might want to review this session from the 2019 DEV Summit: https://esri.github.io/arcgis-pro-sdk/techsessions/2019/PalmSprings/UnderstandingTheCIM.zip This is the video: ArcGIS Pro SDK for .NET: Understanding the CIM, a Guide for Developers Examine the CIM of a map frame, specifically its "Grids" collection. https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic14379.html.. This is where u would add your grid style item - and is what the API will do for u - without needing to manipulate the CIM - at 3.2.
... View more
03-08-2023
09:42 AM
|
0
|
3
|
4698
|
|
POST
|
this might help : ProConcepts-Editing#editcompletedevent . The edit has completed so u wont "skip" it if that is what u r wondering.... That said, if u do execute Project.Current.UndoEditAsync() within the event I would expect it to be re-entrant so be prepared to deal with that (and not end up in a continuous loop) Refer to EditCompletedType on the event args
... View more
03-08-2023
09:16 AM
|
1
|
1
|
1177
|
|
POST
|
Looks like u need menu "esri_editing_data" This is how I find the menu/group/tab etc I want in the DAML: Step 1: Turn "show command ids on screen tips" on in the backstage options. Step 2: Hover over an item already on the menu/group/etc u want. Pay attention to the DAML ID. Step 3: Search for the DAML ID (from step 2) in the Pro install folder in the Pro *.daml files Step 4: Look for all refIDs - that is where it is used in the application. In this case, there are two: "esri_editing_data" for layers and "esri_editing_standalonetable_data_menu" for standalone tables. You want "esri_editing_data" for layers".
... View more
03-06-2023
07:08 AM
|
1
|
1
|
1783
|
|
POST
|
right, no, sorry, i don't. could be that at 2.x the internals were likewise making a copy of the (internal) inspector attribute collection in the Modify call but are now just holding a reference (as an optimization of sorts)....that's a guess just based on the change in behavior u r seeing tho.
... View more
02-27-2023
02:01 PM
|
1
|
0
|
3271
|
|
POST
|
i suspect it is because u hv one inspector that u r loading/reloading in the loop. Try passing the attributes inside a dictionary to the modify instead....something like: //use attribute dictionary
var dict_attrib = new Dictionary<string, object>();
dict_attrib["EST_AVG_DEPTH"] = insp["EST_AVG_DEPTH"];
editOp.Modify(gravitySewerLayer, oid, dict_attrib); [assuming Modify makes a copy of your dictionary when u call it....which i think it does....otherwise the "new" has to go outside the loop and u wld hv to hang on to the dict reference(s).....e.g. var list_dict = new List<Dictionary<string,object>>();]
... View more
02-27-2023
01:46 PM
|
1
|
1
|
3277
|
|
POST
|
>Is it possible to get the layername that the geometry in the Sketch buffer belongs to? no. note - layers, as a term, relates to the content of the map (and are shown in the map table of contents). feature classes (or, somewhat, more generically, feature datasets) relates to the content in a GDB. A (feature) layer contains a feature class, sometimes called its "data source". A _feature_, which is a row containing a geometry within a feature class, is "the" link u want to go from a geometry to a feature class (in your GDB). Typically, features are retrieved through selections (i.e. whatever it is that is _selected_ on the map - and will be highlighted in blue).
... View more
02-22-2023
08:47 AM
|
1
|
0
|
2309
|
|
POST
|
this will be fixed in 3.2. we will get the fix into next available patch for 3.0
... View more
02-16-2023
01:55 PM
|
1
|
0
|
1357
|
|
POST
|
That looks like a bug in Pro. It seems the checkbox on the licensing tab cannot find the property it is bound too - presumably because of a typo. I will check with the development team. Is this 3.0?
... View more
02-14-2023
05:17 PM
|
0
|
2
|
1412
|
|
POST
|
the order in the selection set is controlled by object id I believe and not the order in which features are selected.
... View more
02-01-2023
07:30 AM
|
0
|
1
|
2716
|
|
POST
|
as all features have the same edit being applied (a "move") i suspect that it has more to do with the order in which the features are ordered in the selection set. So the first feature in the selection set is probably moved first, the second moved second, etc. I dont think the order in which u register for events has any bearing on the order in which u receive the events.
... View more
01-31-2023
09:21 AM
|
0
|
1
|
2742
|
| 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
|