Book a Demo

Author Topic: Script diagram "collapse embedded elements"?  (Read 7636 times)

Mr Stuff

  • EA User
  • **
  • Posts: 64
  • Karma: +0/-0
    • View Profile
Script diagram "collapse embedded elements"?
« on: July 19, 2017, 07:06:13 pm »
Can anyone tell me what/how to set/clear?

A quick check of the diagram's extended style shows the parameter isn't in there... nor do I see any other obvious location for it.

Thanks - Julian

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Script diagram "collapse embedded elements"?
« Reply #1 on: July 19, 2017, 10:17:12 pm »
It's simply done by removing/adding the according diagramObject.

q.

Mr Stuff

  • EA User
  • **
  • Posts: 64
  • Karma: +0/-0
    • View Profile
Re: Script diagram "collapse embedded elements"?
« Reply #2 on: July 20, 2017, 03:41:23 pm »
Thanks, but that's not really the issue The diagram properties dialog* has a check box to "collapse embedded objects", which reduces their appearance to black dots on the element edge.

I don't want to remove the diagram objects merely enable/disable this display option.

*right-click on diagram background... Properties... Elements... "collapse embedded objects" check box.

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Script diagram "collapse embedded elements"?
« Reply #3 on: July 20, 2017, 03:50:59 pm »
Hi Mr Stuff,

I don't catch your issue. Think about making a little concrete example. What embedded objects do you have in mind? A little picture would make it clear.

In EA you can control the appearance of:
- Diagram
- Diagram nodes
- Diagram links

If you want e.g. not show Ports on a Diagram, there is at least one Addin that solves the issue.

Kind regards,

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Script diagram "collapse embedded elements"?
« Reply #4 on: July 20, 2017, 04:13:29 pm »
Can anyone tell me what/how to set/clear?

A quick check of the diagram's extended style shows the parameter isn't in there... nor do I see any other obvious location for it.

Thanks - Julian

t_diagram.StyleEx includes "CEE=1;"
The Sparx Team
[email protected]

Mr Stuff

  • EA User
  • **
  • Posts: 64
  • Karma: +0/-0
    • View Profile
Re: Script diagram "collapse embedded elements"?
« Reply #5 on: July 20, 2017, 04:29:53 pm »
@KP  :) I just found that while waiting for further answers...

following fragment toggles Collapse Embedded Elements

Code: [Select]
newStyleEx = curDiag.StyleEx
if instr(newStyleEx, "CEE=1;") > 0 then
newStyleEx = Replace (newStyleEx, "CEE=1;", "")
else
' just to be safe, follow the Sparx pattern of putting the CEE=1 value just before the Theme
newStyleEx = Replace (newStyleEx, "Theme=", "CEE=1;Theme=")
end if
curDiag.StyleEx = newStyleEx
curDiag.Update
Repository.ReloadDiagram(curDiag.DiagramID)

Thanks, Julian