Author Topic: Hide Relationships  (Read 394 times)

rupertkiwi

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Hide Relationships
« on: August 11, 2017, 02:58:18 pm »
Hi,

Does anyone know the API call to hide all relationships in a diagram?

Right click on the diagram --> Properties -->Connectors --> Show Relationships ?

Thanks,
Rupert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 5811
  • Karma: +70/-71
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Hide Relationships
« Reply #1 on: August 11, 2017, 04:44:28 pm »
Hi,

Does anyone know the API call to hide all relationships in a diagram?

Right click on the diagram --> Properties -->Connectors --> Show Relationships ?

Thanks,
Rupert
No, because there isn't one - at least one you have access to.

It may come as a surprise to find that, internally, Sparx uses a different API set than available to us poor users (certainly was the case a decade ago) they may be using more of the public API these days.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

qwerty

  • EA Guru
  • *****
  • Posts: 8849
  • Karma: +134/-120
  • I'm no guru at all
    • View Profile
Re: Hide Relationships
« Reply #2 on: August 11, 2017, 06:09:20 pm »
Most likely they simply loop through the existing t_diagramlinks and set them to hidden where the diagram is not the current one.

q.

Arquesoft

  • EA User
  • **
  • Posts: 66
  • Karma: +0/-0
    • View Profile
Re: Hide Relationships
« Reply #3 on: August 12, 2017, 02:19:57 am »
Most likely they simply loop through the existing t_diagramlinks and set them to hidden where the diagram is not the current one.

q.

Note "there is no need for a connector to have an entry in the table t_diagramlinks" (as explained in http://www.sparxsystems.com/forums/smf/index.php/topic,38532.msg239417.html#msg239417 ) so maybe you have first to create the registry in the t_diagramlinks table.

rupertkiwi

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Hide Relationships
« Reply #4 on: August 14, 2017, 03:57:50 pm »
Got it:

testDiagram.ExtendedStyle = "HideRel=1;ShowTags=0;ShowReqs=0;ShowCons=0;OpParams=1;ShowSN=0;ScalePI=0;PPgs.cx=1;PPgs.cy=1;PSize=9;ShowIcons=1;SuppCN=0;HideProps=0;HideParents=0;UseAlias=1;HideAtts=0;HideOps=0;HideStereo=0;HideEStereo=0;FormName=;"

Setting HideRel to 1 hides all the connectors in a diagram

Thanks to everyone for their help
Rupert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 5811
  • Karma: +70/-71
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Hide Relationships
« Reply #5 on: August 14, 2017, 05:58:49 pm »
Got it:

testDiagram.ExtendedStyle = "HideRel=1;ShowTags=0;ShowReqs=0;ShowCons=0;OpParams=1;ShowSN=0;ScalePI=0;PPgs.cx=1;PPgs.cy=1;PSize=9;ShowIcons=1;SuppCN=0;HideProps=0;HideParents=0;UseAlias=1;HideAtts=0;HideOps=0;HideStereo=0;HideEStereo=0;FormName=;"

Setting HideRel to 1 hides all the connectors in a diagram

Thanks to everyone for their help
Rupert
You did that via Setting the value directly in StylEx not via a direct API call, yes?

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Uffe

  • EA Practitioner
  • ***
  • Posts: 1033
  • Karma: +80/-5
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Hide Relationships
« Reply #6 on: August 14, 2017, 08:19:54 pm »
You did that via Setting the value directly in StylEx not via a direct API call, yes?
Depends on what you mean by "directly." Diaram.ExtendedStyle is a Read/Write attribute ("An extended style attribute."). However, the individual property-value pairs that go in it are undocumented, so manipulating them is very clunky.

Not to be confused with Diagram.StyleEx (Read/Write, "Advanced style settings, reserved for the use of Sparx Systems."). Whose contents are also undocumented. :)

(I'm pretty sure StyleEx corresponds to t_diagram.StyleEx while ExtendedStyle corresponds to t_diagram.PDATA. But don't quote me.)

What qwerty was talking about was hiding individual connectors. That's DiagramLinks.IsHidden / t_diagramlinks.Hidden.


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

qwerty

  • EA Guru
  • *****
  • Posts: 8849
  • Karma: +134/-120
  • I'm no guru at all
    • View Profile
Re: Hide Relationships
« Reply #7 on: August 14, 2017, 09:16:51 pm »
Yes, I (once again :() was not reading carefully and talked about  the "Hide connector in other diagrams" context menu.

q.

rupertkiwi

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Hide Relationships
« Reply #8 on: August 15, 2017, 01:04:07 pm »
Hi Paolo,

i updated this via an API call, not via SQl.

Thanks,
Rupert