Book a Demo

Author Topic: How to add new model (root node)  (Read 3530 times)

RainerQ

  • EA User
  • **
  • Posts: 122
  • Karma: +1/-0
    • View Profile
How to add new model (root node)
« on: October 26, 2010, 01:49:48 am »
Hi,

how can I add a new root node to a model?

I tried
...
repository.Models.AddNew("MyRootNode", "Package");                
repository.RefreshModelView(0);
...
but  it does not work. No new root node shows up  :'(

Thanks for hints and help.

Regards
Rainer

george75

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: How to add new model (root node)
« Reply #1 on: October 26, 2010, 05:24:57 am »
Hey,
I think this should help you

Package rootNode = repository.GetModels().AddNew("MyRootNode", "");
if(! (rootNode.Update)){
//Error
}

RainerQ

  • EA User
  • **
  • Posts: 122
  • Karma: +1/-0
    • View Profile
Re: How to add new model (root node)
« Reply #2 on: October 26, 2010, 06:40:09 pm »
Thanks George, that helped.

Regards
Rainer