Sparx Systems Forum
Enterprise Architect => Bugs and Issues => Topic started by: jack89 on March 05, 2021, 09:45:59 pm
-
Hi all,
I'm using EA to develop a complex system and in some part I would like to add an index of content inside the main page topic.
Let me explain better: imagine that I have this package structure:
- Project CAR manufacturer
|
--> Main page (this is a package diagram that reflects the project structure)
|
--> "Motor"
|
--> "Cylinders"
|
--> "Gears"
|
--> "Behaviors"
|
--> "Start"
|
--> "Stop"
I would like in the main page a sort of table of content that contains hyperlinks to each sub-diagram that reflect also hierarchy
Is there a way to implement this?
Thank you so much in advance
-
You can definitely do that manually, by dragging diagrams to your index diagram, and select "as hyperlink".
It's also possible to automate that with a little script.
If you are familiar with scripting in EA that's not more than an hour or two of work.
Geert
-
So far I did it manually, but I would like to do it with a little script.
Could you indicate me a simple way to do this? (also linking a documentation on how to write script in EA).
-
scripting documentation can be found here: https://www.sparxsystems.com/enterprise_architect_user_guide/15.2/automation/the_scripter_window.html (https://www.sparxsystems.com/enterprise_architect_user_guide/15.2/automation/the_scripter_window.html)
A bunch of example code here: https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library (https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library)
In this case you would need to traverse your model, and add hyperlinks to your index diagram.
To create a hyperlink to a diagram, on a diagram, you first need to create the hyperlink element Package.Elements.AddNew() and then create a new DiagramObject referencing your hyperlink element using Diagram.DiagramObjects.AddNew()
Geert
-
You also take a look at my Sparx Community article
https://community.sparxsystems.com/tutorials/1258-navigable-html-publication (https://community.sparxsystems.com/tutorials/1258-navigable-html-publication)
Which is about creating Navigable models, primarily for HTML output, but the principle of structuring the browser, creating index pages and creating links to diagrams can be applied to your situation
There is an issue with the website which is serving up the images for this article, but my email address is at the bottom of the article, so please contact me if want a copy of the original document complete with images
Phil