Book a Demo

Author Topic: Which field in which table contains the diagram?  (Read 5594 times)


Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Which field in which table contains the diagra
« Reply #1 on: January 12, 2009, 09:01:49 am »
Are you wanting the diagram as an image?

This isn't stored in the database, but if you use the automation interface you can get it.
« Last Edit: January 12, 2009, 09:02:19 am by simonm »

cvg

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Which field in which table contains the diagra
« Reply #2 on: January 12, 2009, 09:50:10 am »
I'm trying to access a diagram using the Automation Interface and Access VBA d place the diagram in a word document at a bookmark.   I can retrieve a string field and place it in a word doc but I can't do this for a diagram.  These are the 2 lines I'm using - the first one works, the second doesn't:
objWord.ActiveDocument.Bookmarks("Heading").Range.Text = MyRecordSet.Fields.Item(2)

objWord.ActiveDocument.Bookmarks("Diagram").Range.Text = MyRep.GetDiagramByGuid(MyRecordSet.Fields.Item(4))

Any help would be most welcomed!  

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Which field in which table contains the diagra
« Reply #3 on: January 12, 2009, 10:11:28 am »
If you want to get an image of the diagram, look at using either the PutDiagramImageOnClipboard or PutDiagramImageToFile methods on the EA.Project object.
http://www.sparxsystems.com/uml_tool_guide/sdk_for_enterprise_architect/project_2.html

cvg

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Which field in which table contains the diagra
« Reply #4 on: January 12, 2009, 11:56:42 am »
I'm not having much success in instantiating a ProjectInterface nor in calling the method to copy to clipboard.  Can you provide me with a snipet of code to do this?  Many thanks

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 591
  • Karma: +7/-0
    • View Profile
Re: Which field in which table contains the diagra
« Reply #5 on: January 12, 2009, 12:09:37 pm »
There is a full VB 6 program and code available for generating documents.  For the code see:
http://www.sparxsystems.com.au/resources/developers/autint_vb.html

There is a routine in this - PasteDiagram() that is a good example.
« Last Edit: January 12, 2009, 12:10:18 pm by Dermot »

cvg

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Which field in which table contains the diagra
« Reply #6 on: January 12, 2009, 09:14:46 pm »
Thank you all for your help.  I've got it working now.