Author Topic: Header with Diagram view  (Read 329 times)

Werner

  • Newbie
  • *
  • Posts: 2
Header with Diagram view
« on: May 14, 2021, 20:20:07 PM »
I created a working jarchi script that retrieves/stores diagram metadata (name, version, create/update dates and author from/to the diagram properties (or asks for it in a dialog), and pastes a header with that data (note) on top of the diagram.

For new diagrams, I would like to also paste a direct reference to the start diagram (a capability model), that I created so that users can easily get to the diagram they look for.

My question is: how to do this in jarchi? While adding existing concepts to a view is no problem, I did not succeed in adding an existing diagram view.
« Last Edit: May 14, 2021, 20:29:57 PM by Werner »

projetnumero9

  • Member
  • **
  • Posts: 18
Re: Header with Diagram view
« Reply #1 on: May 14, 2021, 21:45:38 PM »
Hi Werner,
If I understood correctly your point, check: https://gist.github.com/projetnumero9/3301cfb99d8747c79a8bd6e0edcec32e

I wanted with this script to add a link (
Code: [Select]
.createViewReference()) to a parent view(comment line 9, code line 37),
Not exactly your point but that's the spirit,

Best regards,


Werner

  • Newbie
  • *
  • Posts: 2
Re: Header with Diagram view
« Reply #2 on: May 15, 2021, 11:17:53 AM »
Hi Werner,
If I understood correctly your point, check: https://gist.github.com/projetnumero9/3301cfb99d8747c79a8bd6e0edcec32e

I wanted with this script to add a link (
Code: [Select]
.createViewReference()) to a parent view(comment line 9, code line 37),
Not exactly your point but that's the spirit,

Best regards,

Thank you very much, your help solved my problem:
Code: [Select]
var archimateView = selection.filter("archimate-diagram-model").first()
var currentConceptView = $(".Capability Model").filter("archimate-diagram-model").first() ;
var viewRef = archimateView.createViewReference(currentConceptView, 10, 10, 120, 90);

Your script as-is is also very helpful for me for creating layered diagrams!

Best Regards,
Werner