Book a Demo

Author Topic: Hiding Diagram Objects on a diagram  (Read 11656 times)

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Hiding Diagram Objects on a diagram
« on: November 06, 2019, 10:13:02 am »
Hey all

My understanding has always been that (unlike diagram links), there is no "IsVisible" attribute or equivalent that can be used to suppress a diagram object from being visible on a diagram.

However, if I look at the link below, it lists Elements as having the following two properties that can be access from shape scripts:

IsVisible, and
Visibility

So the obvious answer, is "what gives"?

https://sparxsystems.com/enterprise_architect_user_guide/14.0/modeling_tools/displaying_element_properties.html

Cheers

Jays :-)

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Hiding Diagram Objects on a diagram
« Reply #1 on: November 06, 2019, 11:11:29 am »
IsVisible I think is mainly for processing child elements. See Example 3 on the following page about custom compartments:
https://www.sparxsystems.com/enterprise_architect_user_guide/15.0/modeling/add_custom_compartments_to_ele.html

I'm not 100% sure what the Visibility property is though. At first I thought it might be the Scope (Public, Private etc) since that sometimes gets referred to as Visibility in other places, but doesn't seem to be the case here.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Hiding Diagram Objects on a diagram
« Reply #2 on: November 06, 2019, 11:26:14 am »
IsVisible I think is mainly for processing child elements. See Example 3 on the following page about custom compartments:
https://www.sparxsystems.com/enterprise_architect_user_guide/15.0/modeling/add_custom_compartments_to_ele.html

I'm not 100% sure what the Visibility property is though. At first I thought it might be the Scope (Public, Private etc) since that sometimes gets referred to as Visibility in other places, but doesn't seem to be the case here.
Visibility may be related to the [Ctrl+F9]|Objects|Advanced,  It seems to be related to Element Visibility.

Thomas, in his excellent book, lists Visibility as "Always NULL?!"

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: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Hiding Diagram Objects on a diagram
« Reply #3 on: November 06, 2019, 12:04:17 pm »
Just guessing: connectors can be set invisible. Maybe that property only works on connectors being set invisible. But then: why evaluate it in a shape script if the connector is invisible anyway? So many strange things in EA. Another guess: it's just a wrong documentation.

q.

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Hiding Diagram Objects on a diagram
« Reply #4 on: November 06, 2019, 12:13:00 pm »
I have wondered if that is the case.

Do you know if I can access the IsSelectable property of an element from the shape script?
The same webpage doesn't list as being accessible, which seems strange to say the least.

I have added a diagram property called "Visible" to my stereotypes and modified the shape script to show nothing when this is set.
However, I cannot find a way to set diagram properties of individual diagram objects from scripting.

As a backup, maybe I can set the IsSelectable switch from scripting and then modify the shape script to display nothing when THAT switch is set?
But to do that I need to be able to detect it in the shape script!

Cheers

Jays :-)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Hiding Diagram Objects on a diagram
« Reply #5 on: November 06, 2019, 04:33:45 pm »
Hi Jays,

IIRC, the User Specific Diagram Properties end up in the ObjectStyle column of t_diagramobjects.  They aren't available directly from the API, you need to parse the column.

If you search for "User Specific Diagram Propert" you'll find a lot of stuff on how they need to be improved.

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

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Hiding Diagram Objects on a diagram
« Reply #6 on: November 06, 2019, 04:39:36 pm »
Hey Paolo

Thanks for that! Am I able to get and set the contents of that column from the API somehow?
I'm not adverse to a little bit of parsing if I can get hold of the data in the column.

Cheers

Jays :-)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Hiding Diagram Objects on a diagram
« Reply #7 on: November 06, 2019, 05:28:37 pm »
Hey Paolo

Thanks for that! Am I able to get and set the contents of that column from the API somehow?
I'm not averse to a little bit of parsing if I can get hold of the data in the column.

Cheers

Jays :-)
DiagramObject.Style  Search for DiagramObject Class in the Help.

Paolo

[Edit: They're actually in Diagram.StyleEx referencing a DUID in DiagramObjects.  See later posts from KP]
« Last Edit: November 07, 2019, 03:57:52 pm by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Hiding Diagram Objects on a diagram
« Reply #8 on: November 06, 2019, 07:47:30 pm »
See p. 58 of my Inside book: DiagramObject.StyleEx has a CSV value NSL=1/0

q.

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Hiding Diagram Objects on a diagram
« Reply #9 on: November 07, 2019, 05:32:01 am »
Hey Thomas

I have ALL your books which I bought a good number of years ago now.
Looks like you must have changed it from the original as I can't see NSL in there anywhere.
Unfortunately I lost my LeanPub credentials when I left my last company but never mind my current company can give you another generous donation so I can get the updates  ;)

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Hiding Diagram Objects on a diagram
« Reply #10 on: November 07, 2019, 06:40:56 am »
Alrightie, so you should be a handful of dollars richer as I have updated my version of Inside EA.
Looking at page 58, it states that NSL is "1/0 corresponding to the context menu setting Selectable".

However, what I am after is the ability to read from and write to the User Specific Diagram Properties that I define as belonging to a particular stereotype.
Please see the link below for an example of what I am after.

https://sparxsystems.com/enterprise_architect_user_guide/14.0/modeling_tools/query_methods.html

In this scenario, I am looking for a method for reading and writing to the Is Red property for the Red Flag stereotype.

Cheers :-)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Hiding Diagram Objects on a diagram
« Reply #11 on: November 07, 2019, 08:12:19 am »
Hey Thomas

I have ALL your books which I bought a good number of years ago now.
Looks like you must have changed it from the original as I can't see NSL in there anywhere.
Unfortunately I lost my LeanPub credentials when I left my last company but never mind my current company can give you another generous donation so I can get the updates  ;)

Send me a PM and I mail you an update.

q.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Hiding Diagram Objects on a diagram
« Reply #12 on: November 07, 2019, 08:15:07 am »
Hmm. Late for me already. But diagrams don't have stereotype properties (aka TVs) in V13.5. Are there in later versions?

q.

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Hiding Diagram Objects on a diagram
« Reply #13 on: November 07, 2019, 08:45:58 am »
Hey Thomas

The properties I am talking about belong to Element Stereotypes (please see the bottom of the page below).
These are properties that can have different values on different diagrams for the SAME element.

Therefore, I am assuming that they belong somewhere to the DiagramObject class but can't find where to access them.
It is driving me crazy! ;-)

Cheers

Jays :-)



https://sparxsystems.com/enterprise_architect_user_guide/14.0/modeling_tools/query_methods.html

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Hiding Diagram Objects on a diagram
« Reply #14 on: November 07, 2019, 09:20:26 am »
I haven't dealt with these diagram properties. Not sure if V13.5 has them. I do have V14 but actually work just with 13.5. Will have a look tomorrow.

q.

P.S. I tried locating something in the help that tells how to create that in a MDG: of course no luck. That picture just looks like something I never saw before. Es ist zum Knochen kotzen (don't try to translate, it's sort of a curse. Nothing to beep away, though)

P.P.S: Don't try to find these. It's anyway part of the MDG stuff which is held in memory. No access to us dumb users. If someone can give me a hint where to find info about these <<diagram property>> attributes: thanks in advance.
« Last Edit: November 07, 2019, 09:38:30 am by qwerty »