Import layout file and use existing map

1936
3
Jump to solution
02-06-2022 03:22 AM
MohamedG
Esri Contributor

Hello,

I am trying to import a layout file (.pagx) to the ArcGIS Pro project using the following code snippet and it works properly but it adds new map to the project each time.

IProjectItem layoutItem = ItemFactory.Instance.Create(file, ItemFactory.ItemType.PathItem) as IProjectItem;
Project.Current.AddItem(layoutItem);

I want to reuse the existing map in the project like when you import a file manually you have the option to reuse existing maps.

Reuse_Maps.png

Is there any wasy I can do this using the SDK?

Thank you.

0 Kudos
1 Solution

Accepted Solutions
JeffBarrette
Esri Regular Contributor

We added this capability to the Pro SDK at 3.0.  Thank you for your feedback.

Jeff - arcpy.mp and Layout teams

View solution in original post

0 Kudos
3 Replies
JeffBarrette
Esri Regular Contributor

Thank you for your feedback.  The only solution currently is to remape the map frame and map surrounds to the current maps and then delete the newly added project item.  We are looking into adding method parameters to accomodate the UI setting.

Jeff - Layout and arcpy.mp teams.

0 Kudos
MohamedG
Esri Contributor

Thank you very mush for response.

I hope it will be available soon.

0 Kudos
JeffBarrette
Esri Regular Contributor

We added this capability to the Pro SDK at 3.0.  Thank you for your feedback.

Jeff - arcpy.mp and Layout teams

0 Kudos