Where can I find the reference path of an element?

Hi,

I’m trying to understand where in the SysIDE element can I find the reference path? Is it stored at all?

Say I have this model:

package A {

    part def Electrical {
        attribute Power;
    }

    part Motor : Electrical {
        redefines Power = 500;

        part Coil {
            attribute Material = "Copper";
            attribute Resistance = 100;
        }

        part Rotor {
            attribute Type = "Wound";
        }
    }
}

I want to get the path of, e.g., A::Motor::Coil::Material

It is stored and you can simply use

str(element)

that will give you what you are looking for!

1 Like

You can get a structured version using element.qualified_name (which allows you to access the individual parts A, Motor, Coil, Material). str(element.qualified_name) turns it into the usual A::Motor::Coil::Material representation.

3 Likes