Book a Demo

Author Topic: How to get the type of selected diagram  (Read 14643 times)

dangel

  • EA User
  • **
  • Posts: 74
  • Karma: +0/-0
    • View Profile
How to get the type of selected diagram
« on: December 07, 2014, 05:17:33 am »
I am developing a tools in c#,
I need to get the type of the selected diagram in order to do some methods according to the type of the diagram, for example if the diagram of type use case then I will call some functions for that and so on if the diagram is of type class or sequence, etc,

I could get the selected package but I tried for getting selected diagram , but could not, could someone help me?

Regards,


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: How to get the type of selected diagram
« Reply #1 on: December 07, 2014, 06:36:24 am »
What do you mean by selected? In the browser or the currently open diagram?

q.

dangel

  • EA User
  • **
  • Posts: 74
  • Karma: +0/-0
    • View Profile
Re: How to get the type of selected diagram
« Reply #2 on: December 07, 2014, 07:13:39 am »
I mean when I right-click on the project browser, select diagram item
please see the image


then my extension should be able to detect the type of that selected item

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: How to get the type of selected diagram
« Reply #3 on: December 07, 2014, 09:12:46 am »
I need to say it Perlish:
Code: [Select]
my $dia = $rep->GetTreeSelectedObject();
print($dia->Type);

q.

dangel

  • EA User
  • **
  • Posts: 74
  • Karma: +0/-0
    • View Profile
Re: How to get the type of selected diagram
« Reply #4 on: December 08, 2014, 07:22:03 am »
Thanks, perfect