Book a Demo

Author Topic: EA docGenerator API generates diagrams twice  (Read 3982 times)

Andreas Morgenstern

  • EA User
  • **
  • Posts: 26
  • Karma: +1/-0
    • View Profile
EA docGenerator API generates diagrams twice
« on: July 19, 2016, 09:51:35 pm »
Hi,

assume we have an Element with two Diagrams below.

Element
     Diagram 1
     Diagram 2

If I generate the documentation generation manually in the context menu of Element, everything works fine.
However, when I use the docGenerator API from within a script the generated rtf-documentation wrongly contains the diagram Diagram 1 twice.

Anybody has an idea?

Andreas

Code: [Select]
var DOCUMENTATION_TYPE=dtRTF;
var OUTPUT_FILE="C:\\Users\\morgenst\\Documents\\test.rtf";;
var ComponentTEMPLATE="ACTL Context Diagram Template";

function main()
{
Session.Output("Documentation Example");
// Create a document generator object
var docGenerator as EA.DocumentGenerator;
docGenerator = Repository.CreateDocumentGenerator();
// Create a new document
Session.Output("Documentation Generator created");
if ( docGenerator.NewDocument("") )
{
generationSuccess = docGenerator.DocumentElement(4749, 0, ComponentTEMPLATE );
if ( !generationSuccess )
Session.Output( "Error generating Component documentation: " + docGenerator.GetLastError() );
success=docGenerator.SaveDocument(OUTPUT_FILE,DOCUMENTATION_TYPE);
if (!success)
Session.Output("Error saving to File:"+docGenerator.GetLastError());
Session.Output( "Done!" );

}
else
{
Session.Output( "Could not create new document: " + docGenerator.GetLastError() );
}

}


main();