Book a Demo

Author Topic: Find dragged diagrams  (Read 4112 times)

Timmie

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Find dragged diagrams
« on: August 22, 2007, 10:58:21 pm »
Hi,

I have a problem with my EA Plugin written in C#.
It's searching in all subdiagrams of an element. That works fine with "element.Diagrams" but when I drag the subdiagram to another Package, the "element.Diagrams" method is empty.

How can I find these dragged diagrams?

thomaskilian

  • Guest
Re: Find dragged diagrams
« Reply #1 on: August 23, 2007, 01:16:11 am »
I guess you can't since you dragged it away. You could create a <<trace>> manually (or via automation) to keep track of it.

Timmie

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Find dragged diagrams
« Reply #2 on: August 23, 2007, 02:07:32 am »
Thanks for replying, but when I click manually on the element the dragged diagram still appears.
There must be a link between these 2 objects. I just want to get that link at runtime.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Find dragged diagrams
« Reply #3 on: August 23, 2007, 02:45:33 am »
Hi Tim,

As Thomas says, because you dragged it away, it won't appear under that function - since it ONLY returns the diagrams immediately under that element.  The link still exists as you indicate because the database still retains the link.

You need the function that returns the referenced composite diagram.  I don't know which that is (since I'm not an automation expert) a quick look at the help didn't find it - but that means nothing...

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Timmie

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Find dragged diagrams
« Reply #4 on: August 23, 2007, 04:09:59 am »
The only way I found to get the dragged diagram ID:

Repository.SQLQuery("Select o.PDATA1 from t_object o where o.Name = '" + element.Name + "'")

But I didn't like this solution, is there a better one?
« Last Edit: August 23, 2007, 04:18:45 am by Timmie »

thomaskilian

  • Guest
Re: Find dragged diagrams
« Reply #5 on: August 23, 2007, 04:31:34 am »
There is AFAIK a way to retrieve the PDATA via automation (you need to RTFM or search the forum, it has been mentioned). But that would likely be an iterative search, far slower than your SQL. I guess it's okay to do it this way. The DB structure is quite stable. Just encapsulate your coding...

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Find dragged diagrams
« Reply #6 on: August 23, 2007, 06:22:14 am »
Quote
There is AFAIK a way to retrieve the PDATA via automation (you need to RTFM or search the forum, it has been mentioned). But that would likely be an iterative search, far slower than your SQL. I guess it's okay to do it this way. The DB structure is quite stable. Just encapsulate your coding...

The MiscData() array retrieves these fields. [The docs note that MiscData(0) is PData1 and so forth.]
Note that these fields are read only via the API.

Hopefully there will be better documentation in the future about what these fields contain and how they are formatted. Follow the EA SDK as it evolves.

David
No, you can't have it!