Author Topic: Group elements  (Read 800 times)

emiliano.davila

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Group elements
« on: August 06, 2022, 12:51:14 am »
Hello,
We are trying to group elements using the EA API, but we have not succeeded in any way.
Is it possible to do this by API or by Database?

Best Regards.

qwerty

  • EA Guru
  • *****
  • Posts: 13145
  • Karma: +376/-299
  • I'm no guru at all
    • View Profile
Re: Group elements
« Reply #1 on: August 06, 2022, 12:52:51 am »
Group where?

q.

emiliano.davila

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Group elements
« Reply #2 on: August 06, 2022, 01:10:12 am »
We want to replicate the "Group Elements" functionality in a diagram.


qwerty

  • EA Guru
  • *****
  • Posts: 13145
  • Karma: +376/-299
  • I'm no guru at all
    • View Profile
Re: Group elements
« Reply #3 on: August 06, 2022, 01:15:04 am »
That's probably possible, but likely only when fiddling with the tables directly. I haven't documented that yet and will probably be able to look into it during the weekend.

q.

emiliano.davila

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Group elements
« Reply #4 on: August 06, 2022, 01:34:29 am »
Thank you very much, we look forward to hearing from you.

qwerty

  • EA Guru
  • *****
  • Posts: 13145
  • Karma: +376/-299
  • I'm no guru at all
    • View Profile
Re: Group elements
« Reply #5 on: August 08, 2022, 09:39:35 pm »
Yap, I found it. But I don't have all the details.

What EA does it that it stores grouping information in t_diagram.styleEx. E.g. I have grouped two classes and it added

Code: [Select]
OPTIONS_CA81B41F=GID=0C08:;OPTIONS_D744D373=GID=0C08:;
The OPTIONS_xxx is made from the t_diagramobjects.objectStyle contets. The first of which is
Code: [Select]
DUID=CA81B41F
So that part is doable, though it needs quite some queries to build the group string.

What I have not found out yet is how the
Code: [Select]
GID=0C08:;code is built. It might be a random code. Will see if I can get light into that too.

q.

qwerty

  • EA Guru
  • *****
  • Posts: 13145
  • Karma: +376/-299
  • I'm no guru at all
    • View Profile
Re: Group elements
« Reply #6 on: August 08, 2022, 09:58:42 pm »
A few experiments indicate that the GID code is a random 4-byte GUID.

Of course, the implementation is rotten. After having grouped the two elements I grouped one of them with a third. The result was a new group of the latest two elements and an orphan. Well, it's EA...

q.
« Last Edit: August 09, 2022, 12:59:24 am by qwerty »

emiliano.davila

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Group elements
« Reply #7 on: August 08, 2022, 10:12:59 pm »
Thank you very much. All this information is very useful for us.
We will test and comment on the results.