Author Topic: Shape script: diagram page properties  (Read 5263 times)

Uffe

  • EA Practitioner
  • ***
  • Posts: 1669
  • Karma: +112/-11
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Shape script: diagram page properties
« on: May 12, 2020, 01:43:45 am »
Hello one and all,


When generating documents, diagrams sometimes need to be split into multiple images, which makes it difficult to follow connectors which cross image boundaries. The shape script could be extended with some properties to help alleviate this problem.

Basically, I'm proposing a set of element and connector properties like so:
  • Element: DiagramPageX
  • Element: DiagramPageY
  • Connector: Source.DiagramPageX
  • Connector: Source.DiagramPageY
  • Connector: Target.DiagramPageX
  • Connector: Target.DiagramPageY
These would report what page of a diagram an element is located on.

You could then write a connector shape script which checks whether the source and target elements are on the same page and, if not, outputs a text like (From #Source.Element.Name#) into the appropriate label.

This assumes that you can compare two property values in a shape script, as in
    if (HasProperty("Source.DiagramPageX", "Target.DiagramPageX")) {
... which I haven't actually checked.


Ideally, another property Diagram.DisplayContext or something should be added as well, which would return "GUI", "HTML" or "DOC" depending on the situation in which the diagram is being rendered. That way your connector shape script could kick in only when generating a document.
Alternatively, the DiagramPage properties could always return 1 when not generating a document, but that's not as good (more hidden behavior).


/Uffe
My theories are always correct, just apply them to the right reality.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1669
  • Karma: +112/-11
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Shape script: diagram page properties
« Reply #1 on: May 18, 2020, 07:02:48 pm »
No love for page-layout-aware shape scripts?   :'(
My theories are always correct, just apply them to the right reality.

qwerty

  • EA Guru
  • *****
  • Posts: 11188
  • Karma: +268/-248
  • I'm no guru at all
    • View Profile
Re: Shape script: diagram page properties
« Reply #2 on: May 18, 2020, 10:56:27 pm »
Well, why propose more and more features if the app itself is a bag of bugs?

q.