How to retrieve the REC Source Element of a PhysicalComponent?

Hello,

In the Semantic Browser of a PhysicalComponent, under the Referenced Elements tab, I can see a section named REC Source Element, which shows the originating REC component.

I would like to retrieve this information programmatically.

Any pointers, code examples, or explanation of the model relations involved would be highly appreciated!

Thanks

You can call any semantic browser query by its name form Python for Capella:

my_physical_component.get_query_result("Rec Source Element")

You can also pass the class of the returned elements as the second parameter if you want to.

1 Like

Thanks a lot, Yvan! The command below worked perfectly in my case.

my_physical_component.get_query_result(“REC Source Element”,PhysicalComponent)[0].get_name()

1 Like