Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Dermot

Pages: 1 ... 35 36 [37] 38 39
I am not sure if I read the original post correctly - when reffering to formating in the notes is that EA rich text formating?  If so, try using the EA-SDK routines:
GetFieldFromFormat (string Format, string Text)
GetFormatFromField (string Format, string Text)
See the help for details.

Pardon me butting in without reading all of Midnight's very generous reply, but here is some VB code that I think does do what you want - see pasteDiagram():

Sub DumpDiagrams(Package As Object, Ratio As Integer, bBorder As Boolean, ElementId As Long, Header As Boolean)

'Dump Diagrams
    Dim idx As Integer, diag As Ea.Diagram
    For Each diag In Package.Diagrams
        ' Check if the diagram is directly under the package - don't print if not
        If diag.ParentId = ElementId Then
             If Header Then
                 ' get the Package name and comments
                 WriteLin diag.Name, False, False, "H2"
                 WriteLin diag.Notes, False, False, "NS"
             End If
             ' Place the diagram on the document
             PasteDiagram diag.DiagramGUID, Ratio, bBorder

             WriteLin "Figure " + Str(iFigure) + ": " + diag.Name, True, False, "NS"
             iFigure = iFigure + 1
             EaRepos.CloseDiagram (diag.DiagramID)
        End If
    Set diag = Nothing
End Sub

Public Sub PasteDiagram(sDiagGuid As String, Ratio As Integer, bBorder As Boolean)

    Dim oProject As Ea.Project
    Dim CurrRange As Range
    Set CurrRange = WordApp.ActiveDocument.Content
    CurrRange.Collapse Direction:=wdCollapseEnd
    ' set up a project object to retrieve the graphics
    Set oProject = EaRepos.GetProjectInterface()
    'Copy diiagram from EA to the Clipboard
    ' Paste this diagram to the document from the project Object using guid from package
    If oProject.PutDiagramImageOnClipboard(sDiagGuid, 0) Then
    End If
    If Ratio > 0 Then
        ' Selection.InlineShapes(1).Height * (Ratio / 100)
        WordApp.ActiveDocument.InlineShapes(iFigure - 1).LockAspectRatio = True
        WordApp.ActiveDocument.InlineShapes(iFigure - 1).Width = WordApp.ActiveDocument.InlineShapes(iFigure - 1).Width * Ratio
    End If
    If bBorder Then
        WordApp.ActiveDocument.InlineShapes(iFigure - 1).Borders(wdBorderBottom).LineStyle = wdLineStyleSingle
        WordApp.ActiveDocument.InlineShapes(iFigure - 1).Borders(wdBorderLeft).LineStyle = wdLineStyleSingle
        WordApp.ActiveDocument.InlineShapes(iFigure - 1).Borders(wdBorderRight).LineStyle = wdLineStyleSingle
        WordApp.ActiveDocument.InlineShapes(iFigure - 1).Borders(wdBorderTop).LineStyle = wdLineStyleSingle
    End If
    Set oProject = Nothing
    Set CurrRange = Nothing

End Sub

The full code for this is downloadable from the main Sparx web site dealing with Automation code:

I can't seem to reproduce this - using the standard Master template and generating it with sub-reports the results allow comments in Word where ever the cursor is placed (except on the exterior of a table).
I would suggest you send through a copy of this to the support email for reveiw.

This can be done in a Virtual Document - using a Model Element with a Tagged Value: SearchName &  SearchValue - see the help on Virtual Documents or the Whitepaper on RTF reporting. Requires EA 7.1.

Automation Interface, Add-Ins and Tools / Re: Sequence diagram
« on: September 18, 2008, 03:23:19 pm »
If you have code that you are running under EA's Build, Test & Run then Sequence diagrams can be generated from this - see:
Is that what you are asking for?

I would suggest you have a look at the whitepaper on RTF report gerneation - see the section on Numbering.   The List numbering by default sets 1.0 rather than 1.1 - there is a note in this section:
[Note: As the heading fonts are incremented for nested packages, if a 1.1.1 starter is required rather than 1.0.0, then the List Levels properties | Start At needs to be set for or all list levels.]
For the whitepaper see:

Automation Interface, Add-Ins and Tools / Re: importing requirements
« on: August 05, 2008, 10:31:25 am »
If the other product supports XMI import/export - then is the best process to use, otherwse the CSV import/export is the other option to look at.  There are detail steps on using this in the whitepaper on Requirements Management - see:
There is also an Add-in available for importing DOORS data.

Automation Interface, Add-Ins and Tools / Re: RTF report
« on: July 24, 2008, 11:48:42 am »
There is no direct filtering on the sub-element level of the RTF report generation. If you want to filter at this level it may be best to look into creating a query in the Advanced Search (ctrl-F).

The standard figure numbering is a text field: Figure: {Diagram.Figure}.  This is not directly referenced by other elements. However if you are using Element with Linked Documents -  there is the option to create hyperlinks to the diagrams in the Linked Document - by dragging a diagram from the Project Browser to the linked Document.  If the diagram and the Linked Document are generated in the report then the hyperlink will reference the diagram (Same can be done for elements & Packages).  See EA's help: "Hyperlink From Linked Document".

"Is there any other way to achieve this functionlity in the new RTF editor? "
Yes - the Sections:
Package::Model Document   &
Element::Model Document
Both support the output of RTF data from Linked Documents and Document Artifact Elements.

Automation Interface, Add-Ins and Tools / Re: Diagrams in RTF Reports
« on: June 30, 2008, 04:54:11 pm »
Hello Jason,

The RTF generator is set by default to scale diagrams to the page if larger than a page.  7.1 does support an option in the Diagram Propoerties under the Diagram Tab : RTF Document Options | Divide Diagrams into multiple pages.  You can set this for larger diagrams to ensure scaling does not minimise the diagram.  
In terms long diagrams and of parts of the diagram being off the bottom of a page - there has been a correction for this - but I am not sure which build - you might try the latest build.
Otherwise I would suggest you send through examples to the support email address - see below.

Automation Interface, Add-Ins and Tools / Re: Getting the linked item
« on: June 27, 2008, 03:40:18 pm »
In the VB code available from the download page on:
There are a couple routines dealing with this. See Repository.bas - DumpConnections, as well as, RequirementMain.bas - DumpHeirarchy.  These give two different routines of displaying Element- connector relations.

The RTF report generation largely works on Element Connector relations not Element-Connector-Element (Actor-association-Use Case), so it is best to report the set of Actors and the set of use Cases in one report.  If a different format is required for each, then the Vitual Document: Master Document - Sub-document can be used to set this up.
At present there is no filtering on connector types - we are looking at setting a similar filter to the element filter in the next major release.

Hello Ron,
GetElementByID() requires an ElementID - it won't work for a Diagram ID.  Sounds like you need to loop through the elements of the Diagram.DiagramObjects Collection.

Can you send through an example to SparxSupport to reproduce this(See support below) .

Pages: 1 ... 35 36 [37] 38 39