Select to view content in your preferred language

How to persist custom information to a project.

470
4
06-27-2023 03:24 AM
DirkTillmanns
New Contributor III

Hello everyone,

Pro saves template favorites in the project. Since the favorites are tied to a specific map, it is very likely that they will be saved within the "MapProjectItem". I also need to persist combinations of such EditingTemplates. Does anyone have an idea how I can, for example, couple a json as a custom string to a MapProjectItem (or to the map)?  Are there other ways to persist custom information in the project?

Best regards

Dirk

0 Kudos
4 Replies
Eloy
by
New Contributor II

Hi,

 I know it is not a great solution but in every project you have a Home folder. You can write there a json object  in order to persist information regarding the project.

ArcGIS.Desktop.Core.Project.Current.HomeFolderPath

I hope it helps.

 

0 Kudos
GKmieliauskas
Esri Regular Contributor

Hi,

Look at the ArcGIS Pro community sample BackStage_PropertyPage.

Add-in module has two overridden methods:  OnReadSettingsAsync and OnWriteSettingsAsync. They could help you to save your info to project and get it back.

0 Kudos
DirkTillmanns
New Contributor III

Thanks,

but it would be good to have a link to the map. Otherwise I have to do complex administration when the map changes or is even deleted.

Found this, seems to be a solution.

DirkTillmanns_0-1687865085667.png

 

 

Wolf
by Esri Regular Contributor
Esri Regular Contributor

You can persist custom project or application settings as shown here:

ProGuide Custom settings · Esri/arcgis-pro-sdk Wiki (github.com)

0 Kudos