Hello dear community,
I've created a small program that does create a series of projects and that also creates individual FGDBs inside those projects.
For example, I have a project named f24010 and within that project there is a FGDB named Extract_f24010.
I can see the FGDB in the folder "Folders", but I can't see the same database in the folder "Databases"
Using ArcGIS Pro SDK, how can I add a reference to the FGDB in the "Databases" folder?
Mario
Solved! Go to Solution.
Hi @MarioLandry2 ,
Try that sample code.
Your method need to be async, fgdbpath should be string variable and store your file geodatabase path.
ProgressorSource ps = new ProgressorSource("Adding fgdb connections");
await QueuedTask.Run(async () =>
{
ps.Message = $"Adding fgdb path....";
IProjectItem tmpItem = ItemFactory.Instance.Create(fgdbpath) as IProjectItem;
bool isAdded = Project.Current.AddItem(tmpItem);
}, ps.Progressor);
I've realized that I could use the id command "esri_projectitemAddToProjectButton" but it does not work, mainly because I guess I don't know how to call a command ids with a parameter, in that case the FGDB file name.
Hi @MarioLandry2 ,
Try that sample code.
Your method need to be async, fgdbpath should be string variable and store your file geodatabase path.
ProgressorSource ps = new ProgressorSource("Adding fgdb connections");
await QueuedTask.Run(async () =>
{
ps.Message = $"Adding fgdb path....";
IProjectItem tmpItem = ItemFactory.Instance.Create(fgdbpath) as IProjectItem;
bool isAdded = Project.Current.AddItem(tmpItem);
}, ps.Progressor);
Thanks a lot Than!