Exporting partial diagrams

Hi!
I am trying to use Python4Capella to print out not an entire diagram but just the blocks identified by external informations , I wonder if this is feasible with Python4Capella.
My need would be to highlight some blocks/boxes/functional chains in PAB,SAB or LAB printing them out, depending on informations imported in Capella from external documents (for example an excel).
I know that probably such an operation is possible listing on a document the names of the blocks but i was wondering if it is also possible to print out just a few blocks of a diagram

Hi!
Manipulating diagrams at this level is not possible with the Python API. One idea could be to create those diagrams in Java and then export them using Python4Capella. But it defeat the goal of Python4Capella.
There is a need for diagram manipulation so I will probably try to improve the API in this way. But the way I see it, you will need to create a new diagram for this.
For the moment there is no new development planned for Python4Capella. You can still contact Obeo for commercial support.

1 Like

Isn’t there a java function that we can apply to a component to “hide it” @YvanLussaud ? A function that changes the value of “VisibleInDoc”? Then he could use M2DOC to generate only VisibleInDoc elements? (Or something similar, maybe something that plays on the value related to the property (hidden/not hidden))

You can already change this value in Python4Capella using CapellaElement.get_visible_in_documentation() and read this value with the M2DOc Capella extension service DRepresentation.isVisibleInDoc().
But it will not change the diagram itself. That’s why I think an API to create a diagram or copy a diagram with a filter on element can be a good idea.

1 Like

This is the needed function it if exists:

There is an API in Java:

org.eclipse.sirius.diagram.business.api.helper.graphicalfilters.HideFilterHelper.INSTANCE.hide(diagramElement);

You could try to wrap it as a EASE script and use it from Python4Capella. You can have a look at the Sirius module.

Looks hardcore (complicated),
Noted, might try it someday (if no one has paid for this service yet), thanks.