lightbulb-o get the class an attribute belong to

9 years 2 months ago #1704 by bruno
Hello

for a selected element if it happens to be an attribute of a Class,
I would like to get the Class the attribute belong to.
How can I do that?

Thanks
Bruno

Please Log in or Create an account to join the conversation.

9 years 2 months ago #1706 by chm
Hi bruno,

according to the metamodel documentation , you have to use "getOwner".
for attribute in selectedElements:
  owner = attribute.getOwner()
  print owner

Hope this helps,


chm
The following user(s) said Thank You: bruno

Please Log in or Create an account to join the conversation.

Moderators: chmcma
Time to create page: 0.033 seconds
^ Back to Top