Book a Demo

Author Topic: VBScript - get model diagram in documentation  (Read 4002 times)

jpb1904

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
VBScript - get model diagram in documentation
« on: July 31, 2015, 05:04:16 pm »
I want to create a template fragment that inserts a diagram from my model (use case / flow / activity / etc) in the document section that is generated by the fragment.
I have a VB script part that gets the diagram and saves it on disk as a JPG/BMP/etc, but I want to get it inside my document. How can I do this ?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: VBScript - get model diagram in documentation
« Reply #1 on: August 03, 2015, 11:35:02 pm »
You can't do it that way.
If your diagram is the only one in a package then you can create model document, drag the package on there (so it becomes an attribute) and select the diagram image in the selector.

If it's the only one under a specific element then you can do the same, but instead of using the package use a search to select the element owning the diagram.

If that also doesn't work for you, it might be worth copying the diagram in a package underneath your virtual document and use that instead.

Geert

jpb1904

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: VBScript - get model diagram in documentation
« Reply #2 on: August 04, 2015, 12:29:58 am »
Hello Geert,

Thank you for your reaction, but I think there is some misunderstanding: I have a diagram in my package and I want to put this diagram in a document using a template fragment that is using a piece of script.

So, I'm creating documentation using scripts. And one of these scripts is to get a diagram on paper. What I found until now is to save a diagram with an ID to a JPEG/BMP file somewhere on my PC. Or I can copy the diagram to the clipboard. If I can insert a diagram from the file or paste it from the clipboard, then it'll be ok. But the question is how do I do that?





Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: VBScript - get model diagram in documentation
« Reply #3 on: August 04, 2015, 04:26:58 pm »
Hi jpb1904,

No, I didn't misunderstand. You can't do it that way.

AFAIK you can't put diagram images in script fragments. You can only return text and formatted text with the script.

What I did to overcome this is to make a script that creates my virtual document with all the required sections as model documents.

Geert