Book a Demo

Author Topic: Which Elements are typed by another Element  (Read 4666 times)

Viking

  • EA User
  • **
  • Posts: 478
  • Karma: +2/-2
    • View Profile
Which Elements are typed by another Element
« on: July 03, 2020, 10:15:19 pm »
Hi,

I would like to find out via the EA Object Model, which Elements are typed by a specific Element. Is that possible? Or only with a SQL-statement?

V.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Which Elements are typed by another Element
« Reply #1 on: July 03, 2020, 10:52:57 pm »
If element.ClassifierID != 0 you have the element ID of the classifier. Just use GetElementByID to retrieve it.

q.

Viking

  • EA User
  • **
  • Posts: 478
  • Karma: +2/-2
    • View Profile
Re: Which Elements are typed by another Element
« Reply #2 on: July 03, 2020, 11:59:28 pm »
If element.ClassifierID != 0 you have the element ID of the classifier. Just use GetElementByID to retrieve it.
q.

Many thanks @qwerty. I'll try.

Viking

  • EA User
  • **
  • Posts: 478
  • Karma: +2/-2
    • View Profile
Re: Which Elements are typed by another Element
« Reply #3 on: July 04, 2020, 12:41:03 am »
If element.ClassifierID != 0 you have the element ID of the classifier. Just use GetElementByID to retrieve it. q.

I am sorry. I do not understand the solution.

Maybe my explanation of the issue was misleading.

I have a class A and a class B. Class A has an attribute a. This attribute a is typed with class B.

I want to find out, which classes (here class A only) use class B as type.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Which Elements are typed by another Element
« Reply #4 on: July 04, 2020, 12:44:25 am »
You'll have to use an SQL query to get to the instances.
Use Repository.GetElementSet with this query as parameter

Geert