Book a Demo

Author Topic: Package.Elements is Readonly?  (Read 4503 times)

mogra69

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Package.Elements is Readonly?
« on: October 19, 2006, 05:10:10 pm »

How do we add elements to a Package if Package.Elements is read-only?

I tried Package.Elements.AddNew() method. When I call Update() on the returned Element there's an exception.

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Package.Elements is Readonly?
« Reply #1 on: October 19, 2006, 05:18:14 pm »
Hmmm, not too sure what the problem could be.  Could you perhaps include a small code sample?

Something like the following should result in a new class element beneath the specified package:

Dim e as EA.Element
Set e = pkg.Elements.AddNew("Foo", "Class")
e.Update

mogra69

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Package.Elements is Readonly?
« Reply #2 on: October 19, 2006, 06:11:15 pm »
Thanks. I found the cause of my problem.

I was doing:
Package.Elements.AddNew( "MyClass", "Element")

instead of
Package.Elements.AddNew( "MyClass", "Class")

Thanks for your help.