M2Doc - Logical Architecture Blank generation : names and fonctions

Hello everyone!

I’m a new user of M2Doc and I’m having a bit of trouble achieving what I want with some “Logical Architecture Blank” diagrams.

My final goal is to display all the desired LAB diagrams in the generated document, along with their names. Once all the diagrams are shown, I would like to include a table summarizing all the functions present inside the displayed LABs.

It’s worth noting that I have organized my LAB diagrams within different LogicalComponentPkg.

Currently, I have the following code:

{m:for lcp | self.eAllContents(la::LogicalComponentPkg)->select(p |p.name = ‘LAB 1’ or p.name = ‘LAB 2’)}
{m:lcp.name}
{m:for img | lcp.asImageByRepresentationDescriptionName (‘Logical Architecture Blank’)}
{m:img.setWidth(400)}
{m:endfor}
{m:endfor}

it correctly displays all the diagrams I want (12 diagrams in total : 10 in the LAB 1 LogicalComponentPkg and 2 in the LAB 2 LogicalComponentPkg) with the name of the LogicalComponentPkg, but in its current form, I can’t figure out how to display the names of the diagrams.

If you have any suggestions on how to:

  1. Display the names of the LAB diagrams,
  2. Generate a summary table listing all the functions shown in these LABs,

I would be very grateful!

For your information, I’m working with Capella 7.0.0 and M2Doc 3.3.4.

Thanks in advance for your help!

Hello and welcome,

Instead of using the asImageByRepresentationDescriptionName() service you can use the representationByDescriptionName(). the for variable will be a representation:

{m:for diagram | lcp.asImageByRepresentationDescriptionName('Logical Architecture Blank')}
{m:diagram.asImage().setWidth(400)}
{m:diagram.name}
{m:endfor}

To list LogicalFunction on the diagram:

{m:diagram.representationElements->select(re | if re.oclIsKindOf(diagram::DDiagramElement) then re.visible else true endif).target->filter(la::LogicalFunction)}

This will give you the list of Logical function visible on the diagram.

Thank you very much for the quick answer!
It works perfectly!

1 Like