Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: avantol13-2 on November 07, 2014, 02:30:49 am
-
I just want to create a package underneath another package.
// Get the current package.
EA.Package package = repository.GetTreeSelectedPackage();
// Add a new package.
EA.Package newPackage= (EA.Package)repository.Models.AddNew("New Package Name", "Package");
newPackage.ParentID = package.PackageID;
newPackage.Update();
I get a package but it's at the root level and not under the package I have selected in the project browser.
Thanks,
Alex
-
You need to add your new item to the packages collection of the package
i.e. newPackage = myExistingPackage.Packages.AddNew(...)
-
Yes! That was it. Thank you!