Author Topic: How to add a new child diagram via script  (Read 7700 times)

MoritzH

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
How to add a new child diagram via script
« on: November 03, 2021, 11:35:32 pm »
Welcome,

This is my first post in this forum. I currently work on a interface between a data dictionary and EA and was able to realize almost all requirements with the API in JScript.

However for some problems I did not find a solution yet. For example:


I create different diagrams via script and want to link them. (Right click -> New Child diagram -> select composite diagram). Is there a way to do this with the API? I did not find any property in EA.DiagramObject which would correspond to that.

Thank you an BR
Moritz

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: How to add a new child diagram via script
« Reply #1 on: November 04, 2021, 12:06:07 am »
IIRC
Code: [Select]
Element.SetCompositeDiagram (string GUID)
Sets the composite diagram GUID for the element. A blank GUID will remove the link to the
composite diagram.

q.

MoritzH

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: How to add a new child diagram via script
« Reply #2 on: November 04, 2021, 07:18:59 pm »
Thank you very much qwerty!

I think most of my struggles orgin from me not finding the complete documentation.
For diagram objects I looked into:
https://sparxsystems.com/enterprise_architect_user_guide/14.0/automation/diagramobjects.html

But this method is not listet. Also googling "SetCompositeDiagram" does not really give a helpful result(except for posts in this forum).
Is there a complete documentation for the API you can recomend? :)

BR
Moritz

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: How to add a new child diagram via script
« Reply #3 on: November 04, 2021, 07:51:52 pm »
Well, I put my book together from the pieces thay lay around and made it some sort of learning support. Every now and then I try to update it with newly added functionality. But that a) lags more or less and b) is in most cases not that important as you just need to meet the Pareto principle.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to add a new child diagram via script
« Reply #4 on: November 06, 2021, 02:32:37 am »
(almost) Everything is documented, you just have to look at the right place.
The page you linked was the doucmentation of DiagramObject, not the one for Element.
See https://www.sparxsystems.com/enterprise_architect_user_guide/15.2/automation/element2.html

Geert