DSD-DBS / py-capellambse

A Python 3 headless implementation of the Capella modeling tool.
https://dsd-dbs.github.io/py-capellambse/
Apache License 2.0
50 stars 8 forks source link

Support filtering of model elements with FilterCriterions during diagram export #429

Open kairibu opened 1 month ago

kairibu commented 1 month ago

Ticket #252 introduced the basic support of the Capella Filtering extension. The current functionality lists all FilterCriterions that a model has and the FilterCriterions associated to a specific model element.

It would be great to have to possibility to apply FilterCriterions to diagrams and also context_diagrams before exporting it.

Usage could look like the following:

import capellambse

path_to_model = "xxx.aird"
model = capellambse.MelodyModel(path_to_model, jupyter_untrusted=True)
diagram = model.diagrams.by_name('[LAB] Architecture Overview')
diagram.filters.add(filterCriterions)
diagram.as_svg