Book a Demo

Author Topic: Trouble displaying a package on a Diagram  (Read 3990 times)

aprovis

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Trouble displaying a package on a Diagram
« on: September 01, 2006, 06:27:56 am »
Hi There,

I am trying to automatically generate a diagram to represent the contents of a package.

When using EA manually you are simply able to drag and drop a package on to a diagram and the package is displayed along with it's contents. I cannot however find how to replicate this through the automation interface.

I have looked at the code samples and they only seem to cover adding elements to diagrams. Any help would be much appreciated.

Thanks in advance :-)

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Trouble displaying a package on a Diagram
« Reply #1 on: September 01, 2006, 03:25:34 pm »
As I remember it, you need to set some diagram options before the package contents will display.

This is along the lines of the diagram options dialog when using EA directly. The difference is that the option defaults are all set 'off' when working through the automation interface. You need to either set them for every diagram you create, or build a wrapper class in whatever language you use to do this for you.

The call you will need is:
Code: [Select]
myDiagram.ShowPackageContents = true
[Note that this example is not written in any syntax; tailor it to your chosen language.]

Remember to do this before a call to the .Update() function, as with anything else.

HTH, David
No, you can't have it!

aprovis

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Trouble displaying a package on a Diagram
« Reply #2 on: September 04, 2006, 01:32:53 am »
Thanks for that David.

Do you have any idea how i can display the package contents on the diagram? I've been working from the code samples and user manual but can't seem to find any references to how to display packages instead of elements.

I can create an element of type package but have no idea how to populate it with content.  

If not, do you know of anywhere in which i can look at the methods for the automation interface plugin in detail?

Many Thanks

Aaron :-)

aprovis

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Trouble displaying a package on a Diagram
« Reply #3 on: September 04, 2006, 02:26:16 am »
Hold the phone! I have solved it.

All that was necessary was to use the package.element function to convert the package to an element. it could then be assigned to the diagram. Once i'd done this and ensured that the diagram.showPackageContents = true then the package was displayed.

Many thanks

Aaron :-)