Book a Demo

Author Topic: Add DiagramObjects Packages  (Read 5981 times)

Ceronimo

  • EA User
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Add DiagramObjects Packages
« on: October 06, 2016, 09:45:36 pm »
Hi,
I'm copying Packages (Export Import from a Library into a Project)
I've alread done that with otElements (Classes etc);

But my code doesn't work with packages.

What am i missing ?

                        EA.DiagramObject DO = dDiagram.DiagramObjects.AddNew(p.Name, "");
                       

                        DO.ElementID = p.PackageID;
 

                        DO.Update();


                        Repository.SaveAllDiagrams();
                        dDiagram.Update();
                   
                        Repository.ReloadDiagram(dDiagram.DiagramID);

Ceronimo

  • EA User
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Re: Add DiagramObjects Packages
« Reply #1 on: October 06, 2016, 09:46:07 pm »
the same code with EA.Element works fine

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Add DiagramObjects Packages
« Reply #2 on: October 06, 2016, 09:56:17 pm »
You can not assign a packageId to a diagram object. Use the elementId of Package.Element.

q.

Ceronimo

  • EA User
  • **
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Re: Add DiagramObjects Packages
« Reply #3 on: October 06, 2016, 10:08:26 pm »
Thank you a lot.

!