Book a Demo

Author Topic: Can I select a diagram with InvokeConstructPicker?  (Read 7018 times)

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Can I select a diagram with InvokeConstructPicker?
« on: February 10, 2015, 11:12:36 am »
Okie dokie

I am trying to allow the user to select a diagram using the InvokeConstructPicker method, but it doesn't seem to work.

The following code works perfectly to allow the user to select a class:

filter="IncludedTypes=Class"
Set elementID = Repository.InvokeConstructPicker(filter)

However, if I change the filter as shown below, the user cannot select anything.

filter="IncludedTypes=Diagram"
Set elementID = Repository.InvokeConstructPicker(filter)

Am I doing this wrong or is this simply not possible using this method?


Thanks in advance

Jays  :)

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Can I select a diagram with InvokeConstructPic
« Reply #1 on: February 10, 2015, 01:41:35 pm »
Not possible using this method.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Can I select a diagram with InvokeConstructPic
« Reply #2 on: February 10, 2015, 08:21:30 pm »
 I've already asked to open it up for other types of elements, but no luck so far.

Too bad, escpecially since this would take hardly any effort from Sparx since the ConstructPicker already does that in EA. They only need to make it available via the API. :'(

Geert

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Can I select a diagram with InvokeConstructPic
« Reply #3 on: February 11, 2015, 07:39:00 am »
So is there ANY method within scripting that DOES allow me to do this?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Can I select a diagram with InvokeConstructPic
« Reply #4 on: February 11, 2015, 08:24:52 am »
The construct picker in EA doesn't deal with diagrams at all. There is a separate dialog for that.

No, I don't believe that we have exposed the diagram picker to the API at all.

Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: Can I select a diagram with InvokeConstructPic
« Reply #5 on: February 11, 2015, 08:33:42 am »
Okie, thanks Simon.
At least I know :-)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Can I select a diagram with InvokeConstructPic
« Reply #6 on: February 11, 2015, 05:46:52 pm »
Quote
The construct picker in EA doesn't deal with diagrams at all. There is a separate dialog for that.
I stand corrected. I assumed the construct picker would to diagrams as well, but indeed it doesn't. (I know, if I ASSUME I make an ASS out of U and ME  :-[)
Seems a shame though to build an entirely different dialog for selecting diagrams when you already have a very good dialog to select everything else.

So on my x-mas 2015 list:
- Allow other types such as attributes and operation in the constructpicker when used from automation
- Expose the diagram picker dialog to the API

Thanks

Geert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Can I select a diagram with InvokeConstructPic
« Reply #7 on: February 11, 2015, 05:52:06 pm »
Quote
So is there ANY method within scripting that DOES allow me to do this?

If you don't want to go into developing an add-in then I guess you could ask the user to select or open a diagram before starting the script, or start the script from an opened diagram.
Or you could use vbscripts InputBox to ask for a GUID, or name, or path to a diagram.

With a add-in you can of course build your own dialog to select a diagram and show that to the user.

Geert