This is simple tutorial how to get element ID with script and structured expression in CATIA Magic / Cameo.
Model is available at MBSE Community (please register if not registered yet at go.3ds.com/cyber-systems). Direct link to the model https://r1132100503382-eu1-3dswym.3dexperience.3ds.com/#community:4GJPS8QmTuC4wF8BSLitkw/post:MKT4-3cVTwuZN0cCORVrTg