Book a Demo

Author Topic: So, I have the Sparx Enterprise Architect Trial  (Read 2861 times)

Paul Brun

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
So, I have the Sparx Enterprise Architect Trial
« on: April 09, 2010, 01:56:38 am »
I am tasked to look into UML tools to properly model our existing software. I looked at this specific tool because it appears it could reverse-engineer a set of directories with C# code and it seemed to do the trick. I can see a class diagram for each namespace....

Curious...how can I in a sense "stitch" the diagrams into one massive UML class diagram....some classes have references to others in a difference namespace? Is it a import option? What options do I have?

Also, anyway then to export the massive diagram into like an JPG export? We are looking into buying a couple licenses for a few developers here....

Thanks
Paul

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: So, I have the Sparx Enterprise Architect Tria
« Reply #1 on: April 09, 2010, 08:11:25 am »
EA doesn't provide any automatic options to create such a diagram.  In general it's not going to be of much use.

Look at commands like 'Insert Related Elements' for the kind of tools EA does provide.

However, I've just whipped up a scripting example to add all elements under the selected package to the selected diagram.  A warning though, this could take quite some time, especially the layout at the end.

Code: [Select]
dim left
dim top
dim width
dim height
dim padding
dim layoutLeft
dim layoutWidth

layoutLeft = 10
left = layoutLeft
top = 10
width = 100
height = 100
padding = 30
layoutWidth = 2000


sub AddElementToDiagram ( theDiagram, theElement )
      
      ' Cast theDiagram to EA.Diagram so we get intellisense
      dim currentDiagram as EA.Diagram
      set currentDiagram = theDiagram
      
      ' Cast theElement to EA.Element so we get intellisense
      dim currentElement as EA.Element
      set currentElement = theElement
      
      ' Add the element to the diagram
      dim diagramObjects as EA.Collection
      set diagramObjects = currentDiagram.DiagramObjects
      
      if left + width > layoutWidth then
            left = layoutLeft
            top = top + height + padding
      end if
      
      dim testDiagramObject as EA.DiagramObject
      set testDiagramObject = diagramObjects.AddNew( "l=" & left & ";r=" & left + width & ";t=" & top & ";b=" & top + height & ";", "" )
      testDiagramObject.ElementID( currentElement.ElementID )
      testDiagramObject.Update()
      
      left = left + width + padding
      
end sub

sub AddElementsToDiagram ( theDiagram, thePackage )
      
      ' Cast thePackage to EA.Package so we get intellisense
      dim currentPackage as EA.Package
      set currentPackage = thePackage
      
      ' Iterate through all elements and add them to the diagram
      dim currentElement as EA.Element
      for each currentElement in currentPackage.Elements
            AddElementToDiagram theDiagram, currentElement
      next
      
      ' Recursively process any child packages
      dim childPackage as EA.Package
      for each childPackage in currentPackage.Packages
            AddElementsToDiagram theDiagram, childPackage
      next
      
end sub

dim rootPackage as EA.Package
set rootPackage = GetTreeSelectedPackage()

dim currentDiagram as EA.Diagram
set currentDiagram = GetCurrentDiagram()

AddElementsToDiagram currentDiagram, rootPackage
ReloadDiagram currentDiagram.DiagramID

GetProjectInterface().LayoutDiagram currentDiagram.DiagramGUID, 0
« Last Edit: April 09, 2010, 08:55:11 am by simonm »

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: So, I have the Sparx Enterprise Architect Tria
« Reply #2 on: April 09, 2010, 10:53:02 am »
Quote
Also, anyway then to export the massive diagram into like an JPG export?
Ctrl+T (gives choice of JPG, GIF, BMP, PNG, WMF and EMF)
The Sparx Team
[email protected]

Paul Brun

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: So, I have the Sparx Enterprise Architect Tria
« Reply #3 on: April 09, 2010, 10:54:13 pm »
How about support for XAML? I can see that it works nicely with my C# classes, but I don't see the relationships, but than again, that would make sense if it is parsing through .CS files alone...

Paul