Author Topic: Diagram Image in RTF script template fragment  (Read 6385 times)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Diagram Image in RTF script template fragment
« on: April 16, 2015, 10:37:08 pm »
Hi,

Anyone know if it is possible to include the image of a diagram in the custom section of a RTF script template fragment?

I know how to get elements and output their properties using a script, but I would also like to add a diagram to my template.

Geert

Neil Galbraith

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Diagram Image in RTF script template fragment
« Reply #1 on: January 13, 2016, 10:22:02 pm »
I'm also interested in this or in any way to select a single diagram for a template fragment.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Diagram Image in RTF script template fragment
« Reply #2 on: January 13, 2016, 10:38:26 pm »
I think you can with the new Document Script feature.

Geert

Neil Galbraith

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Diagram Image in RTF script template fragment
« Reply #3 on: January 13, 2016, 11:02:25 pm »
Hi Geert,

Can you point me at some documentation/example?

Thanks

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Diagram Image in RTF script template fragment
« Reply #4 on: January 13, 2016, 11:09:01 pm »
http://www.sparxsystems.com/enterprise_architect_user_guide/12.1/report_generation/custom_query_fragments.html

This is where you end up if you click the Help button on the Custom Query tab.

Geert

Screwtape

  • EA User
  • **
  • Posts: 93
  • Karma: +4/-0
    • View Profile
Re: Diagram Image in RTF script template fragment
« Reply #5 on: January 19, 2016, 09:55:36 pm »
Presumably you find the diagram you want from the element given by #OBJECTID# and then call DocumentDiagram (long diagramID, long nDepth, string templateName).

However, I would be careful, as calling DocumentElement within a document script fragment, currently seems to crash EA. (I've raised a support request regarding this issue, which has been reproduced, and is under investigation.)
Screwtape

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8083
  • Karma: +118/-20
    • View Profile
Re: Diagram Image in RTF script template fragment
« Reply #6 on: January 20, 2016, 09:14:02 am »
Screwtape, that sounds like the issue that was fixed in 1226. Although the only report of it that I've seen was internal.

Screwtape

  • EA User
  • **
  • Posts: 93
  • Karma: +4/-0
    • View Profile
Re: Diagram Image in RTF script template fragment
« Reply #7 on: January 21, 2016, 10:52:05 pm »
Thanks Simon!

I raised this issue and was given the reference 16012968.

Interestingly, having upgraded to 1226, my test case now works, but my real-world program still crashes, so I'll have to try and "enhance" the test case until I can reproduce the real-world crashing I'm getting.

Yours,

Screwtape.
Screwtape

Screwtape

  • EA User
  • **
  • Posts: 93
  • Karma: +4/-0
    • View Profile
Re: Diagram Image in RTF script template fragment
« Reply #8 on: March 31, 2016, 11:44:22 pm »
Hi Everyone!

For information - I've just tried this again in build 1229, and it works fine!

Yours,

Screwtape.
Screwtape