Book a Demo

Author Topic: Duplicate Details in Model Exports  (Read 5221 times)

Polymorph

  • EA User
  • **
  • Posts: 136
  • Karma: +4/-0
    • View Profile
Duplicate Details in Model Exports
« on: November 29, 2016, 07:40:03 am »
Let's say I have two diagrams and want to export them to a document.

Diagram 1 has blocks A and B
Diagram 2 has blocks A and C

I want to construct a template that outputs the "notes" from each block underneath each diagram. But, ideally, I only want to export those notes once.

So, when the exporter gets to Diagram 2, it only outputs the notes from block C (because it previously exported block A)

Does anyone know of any sneaky ways to get EA to do this? Some kind of script that keeps track of the number of times an element has been found during the export process before?!?

Glassboy

  • EA Practitioner
  • ***
  • Posts: 1367
  • Karma: +112/-75
    • View Profile
Re: Duplicate Details in Model Exports
« Reply #1 on: November 29, 2016, 10:00:57 am »
You don't have to use a diagram template for all of it.  You could show the diagrams and use another template for your elements.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Duplicate Details in Model Exports
« Reply #2 on: November 29, 2016, 06:16:45 pm »
Does anyone know of any sneaky ways to get EA to do this? Some kind of script that keeps track of the number of times an element has been found during the export process before?!?
Using the regular document generation process (F8), no. This type of higher-level control of the generation process is not available there.

The only way I know would be to write a script that traverses the model structure and invokes the relevant templates as it goes. In other words, you must take control of the generation process itself, not just of the text it outputs.

You would need one template for the diagram ("Td") and one for the element notes ("Tn"), and then your script would have to keep track of which element's notes had already been output before deciding whether to invoke Tn on any element.

HTH,


/Uffe
My theories are always correct, just apply them to the right reality.