|
POST
|
Hi Simon, Pro implements its own MVVM framework. You can see this when you use Pro SDK templates such as Dockpane. The dockpane item template (available using the Pro SDK in Visual Studio) stubs out the View (XAML user control and code behind file) with the View Model class file. You can also check out the various samples in the arcgis-pro-sdk-community-samples repo for examples of Pro's implementation of MVVM. For your specific scenario, you set the Datacontext of your ProWindow to the "ViewModel" class file. This view model should inherit from ArcGIS.Desktop,Framework.Contracts.PropertyChangedBase base class. I made a simple mockup of a login prowindow sample. Attached. Thanks Uma
... View more
11-01-2019
05:01 PM
|
3
|
1
|
2332
|
|
POST
|
Hi It would be a good idea to check the map project item exists to be safe. Also, you will have to wrap this code within the context of a QueuedTask.Run. Like this: protected override void OnClick()
{
QueuedTask.Run( () => {
var mapProjectItems = Project.Current.GetItems<MapProjectItem>();
var mapProjectItem = mapProjectItems.FirstOrDefault(mpi => mpi.Name.Equals("Map1"));
Map map = mapProjectItem?.GetMap(); //Check if mapProjectItem exists.
ProApp.Panes.CreateMapPaneAsync(map);
});
}
... View more
11-01-2019
03:12 PM
|
1
|
1
|
2191
|
|
POST
|
Hi, Here is a sample that shows you how you get the JSON representation of a Symbol. You can also get thte XML representation of the symbol by using the CIMSymbol.ToXML method instead. SymbolLookup sample Thanks Uma
... View more
10-28-2019
09:41 AM
|
2
|
0
|
2676
|
|
POST
|
There are a few samples in the arcgis-pro-sdk-community-samples repo where view models can be accessed from other user controls or other class files. Code snippet similar to this is used in MagnifierWindow sample: internal MapControlWindow_ViewModel viewModel = null; //member variable
viewModel = new MapControlWindow_ViewModel();
//Now you can access the public methods and properties in the viewmodel like this
viewModel .UpdateMapControlContent(); Code snippet in MetadataBrowserControl sample: //The viewmodel
MetadataBrowserViewModel vm = FrameworkApplication.DockPaneManager.Find("MetadataBrowserControl_Dockpane1") as MetadataBrowserViewModel;
...
vm.DockpaneVisible = System.Windows.Visibility.Visible; //Visibility is set Thanks Uma
... View more
10-24-2019
12:53 PM
|
1
|
1
|
4327
|
|
POST
|
You can use the MapMemberPropertiesChangedEvent class. The MapMemberPropertiesChangedEventArgs class has an "EventHint" property that can be used to find if the Name has changed. Thanks Uma
... View more
10-24-2019
10:22 AM
|
0
|
1
|
1410
|
|
POST
|
Hi Nathan, This feature is not available yet. This will be added to the public API in 2020. Thanks Uma
... View more
10-24-2019
09:48 AM
|
2
|
1
|
2517
|
|
POST
|
Hi, You can create a symbol style file like the mil2525d using the Dictionary Renderer Toolkit This link is also available from the Pro SDK wiki homepage in the what's new section (SDK Resources) Thanks Uma
... View more
10-17-2019
03:32 PM
|
0
|
6
|
3069
|
|
POST
|
Hi Hannah Map scale is a 2D concept. For 3D, to learn about the Camera, please refer to ProConcepts: Map Exploration Camera topic. In 3D, Pro maps the scale selection in the map scale combo to a set roughly equivalent Z values. Thanks Uma
... View more
10-17-2019
02:41 PM
|
0
|
0
|
1034
|
|
POST
|
Hi Max, ItemFactory and Import Contents of an mxd can be imported into Pro. This topic above can help you with it. Using "IProjectMultiItem" interface, you will be able to import the map and layout from an mxd into Pro. Regarding pitemx files, if the online/portal item that is referenced by the .pitemx file is something that can be added to Pro, then yes, it can be imported into Pro also. Thanks Uma
... View more
10-09-2019
08:23 AM
|
1
|
0
|
1432
|
|
POST
|
Hi Rebecca At present, there is no way to modify the report field width using the public API. Report enhancements will happen with the Pro 2.6 release. In the meantime, the report field can be lengthened by using the CIM. A code snippet to accomplish this is provided below. Thanks! Uma protected async override void OnClick()
{
ReportProjectItem reportProjItem = Project.Current.GetItems<ReportProjectItem>().FirstOrDefault(item => item.Name.Equals("Test"));
Report report = null;
await QueuedTask.Run(() => {
report = reportProjItem?.GetReport();
var reportDfn = report.GetDefinition();
var reportSection = reportDfn.Elements[0] as CIMReportSection;
var reportSectionElements = reportSection.Elements;
//we need CIMReportDetails element
CIMReportDetails reportDetails = null;
foreach (var reportSectionElement in reportSectionElements)
{
if (reportSectionElement is CIMReportDetails)
reportDetails = reportSectionElement as CIMReportDetails;
}
CIMParagraphTextGraphic cimParagraphTextGraphicElement = null;
foreach (var reportDetail in reportDetails.Elements)
{
CIMGraphicElement cimGraphicElement = null;
//Check if the "Graphic" in this CIMElement is of type ParagraphicTextGraphic
//And check if the "Text" for this is the field we want.
if (reportDetail is CIMGraphicElement)
{
cimGraphicElement = reportDetail as CIMGraphicElement;
if (cimGraphicElement.Graphic is CIMParagraphTextGraphic) //This is a field
{
//Now check if it is the field we want
cimParagraphTextGraphicElement = cimGraphicElement.Graphic as CIMParagraphTextGraphic;
if (cimParagraphTextGraphicElement.Text.Contains("field-value") && cimParagraphTextGraphicElement.Text.Contains("FieldName"))
{
var textPolygonFrame = cimParagraphTextGraphicElement.Shape as ArcGIS.Core.Geometry.Polygon;
//This where are making the text frame for the field wider by adding 5 units.
cimParagraphTextGraphicElement.Shape = MakeNewTextFrame(textPolygonFrame, 5.0);
}
}
}
}
report.SetDefinition(reportDfn); //Set the modified report cim.
});
}
//Helper function that takes the existing text frame of the field and makes it wider.
private ArcGIS.Core.Geometry.Polygon MakeNewTextFrame(ArcGIS.Core.Geometry.Polygon existingFrame, double additionalWidth)
{
List<MapPoint> listCornerPoints = new List<MapPoint>();
int cornerIndex = 1;
foreach (var cornerPt in existingFrame.Points)
{
//We want to make the frame wider so we have to add additional width to some of the X values of the frame corners.
//The corner points start with the top right and travel counter clockwise.
//Therefore to change the width, we have to modify corners 1, 4 and 5. 5th and 1st corner are coincident.
switch (cornerIndex)
{
case 1:
case 4:
case 5:
//For these we have to add the width
listCornerPoints.Add(MapPointBuilder.CreateMapPoint(cornerPt.X + additionalWidth, cornerPt.Y));
break;
default:
listCornerPoints.Add(MapPointBuilder.CreateMapPoint(cornerPt.X, cornerPt.Y));
break;
}
cornerIndex++;
}
ArcGIS.Core.Geometry.Polygon newWiderTextFrame = PolygonBuilder.CreatePolygon(listCornerPoints, existingFrame.SpatialReference);
return newWiderTextFrame;
}
... View more
10-04-2019
12:17 PM
|
0
|
1
|
1275
|
|
POST
|
This can be done by calling the Copy Features Geoprocessing Tool from a Pro Add-in. GP Tools can be called from an add-in using the ExecuteToolAsync method. Here is a sample that shows how to use ExecuteToolAsync: GeoprocessingExecuteAsync Thanks Uma
... View more
09-30-2019
03:14 PM
|
1
|
1
|
1921
|
|
POST
|
Technically speaking, the Pro add-ins follow a “XCopy” deployment scheme. This means that developers (or installers, install programs, etc) can simply copy the add-in or configuration to the target folder “by hand” and it will “just work” – assuming that the well-known folder is known by Pro. However, RegisterAddin.exe is useful in the following scenarios: 1. Building your add-in (and cleaning your add-in) – In visual studio, we defer to RegisterAddin which has all the logic required to determine the users default folder, extract the guid, make the subdirectory and so forth. The same logic is executed on clean – it removes the folder. 2. Double-click registration – this is handled through the file-type association. Developers can simply “double-click” the .addinx/.proconfigx and RegisterAddin will copy the add-in to its guided folder correctly. 3.Digitally Signed/Not signed – RegisterAddin alerts you to the presence (or not) of a signature. It gives you, the user, the opportunity to accept or not the installation of the add-in (because you do or do NOT trust the publisher) 4. EULA – if a distributor of the add-in includes a EULA then that is presented to the user. Thanks Uma
... View more
09-30-2019
11:30 AM
|
0
|
0
|
3073
|
|
POST
|
Hi Max, 1. The RegisterAddin.exe will install the configuration to the default well-known folder which is "C:\Users\<UserName>\Documents\ArcGIS\AddIns\ArcGISPro\Configurations" You can define additional well known folders using the registry. Using this, you can define locations that are network paths, etc., accessible by multiple uses. 2. Yes, you can script the RegisterAddIn.exe. Here are the command-line flags: 3. Simply deleting the ProConfigX file is sufficient to "uninstall" it. If you are only using the default well-known folder, you could use the RegisterAddIn.exe with the "unregister" flag. For other well-known folders, you can simply delete the proconfigx file. Thank you! Uma
... View more
09-26-2019
11:20 AM
|
2
|
2
|
3073
|
|
POST
|
Hi Stephen To clarify, can you please confirm if you are not able to see the new map in your Project Catalog Pane within the Maps collection like this screenshot below? The code should add the new map to the Maps collection as you see below. You will have to actually open the new Map to see it in a Map View (Code here does that). CreateMap method will not open the map. Thanks Uma
... View more
09-26-2019
11:02 AM
|
0
|
1
|
1645
|
|
POST
|
Hi Alex, The MapMemberPropertiesChangedEvent gets fired when a layer's selectable status changes. If you store the layers current status, then you can compare against that when this event fires. Thanks Uma
... View more
09-20-2019
03:36 PM
|
1
|
1
|
915
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-18-2025 03:09 PM | |
| 1 | 11-04-2025 08:25 AM | |
| 1 | 09-23-2025 09:31 AM | |
| 1 | 11-20-2024 10:50 AM | |
| 1 | 04-28-2025 03:06 PM |
| Online Status |
Offline
|
| Date Last Visited |
Thursday
|