Parameters
- path
- The path to the item on disk
Note: If the path corresponds to a folder or file geodatabase not currently added to the project, the item, if found, will be added to the project (and will be indexed)
//GetItems searches project content var map = Project.Current.GetItems<MapProjectItem>().FirstOrDefault(m => m.Name == "Map1"); var layout = Project.Current.GetItems<LayoutProjectItem>().FirstOrDefault(m => m.Name == "Layout1"); var folders = Project.Current.GetItems<FolderConnectionProjectItem>(); var style = Project.Current.GetItems<StyleProjectItem>().FirstOrDefault(s => s.Name == "ArcGIS 3D"); //Find item uses a catalog path. The path can be to a file or dataset var fcPath = @"C:\Pro\CommunitySampleData\Interacting with Maps\Interacting with Maps.gdb\Crimes"; var pdfPath = @"C:\Temp\Layout1.pdf"; var imgPath = @"C:\Temp\AddinDesktop16.png"; var fc = Project.Current.FindItem(fcPath); var pdf = Project.Current.FindItem(pdfPath); var img = Project.Current.FindItem(imgPath);
Target Platforms: Windows 11, Windows 10, Windows 8.1