Author Topic: Image In Model Addin Window  (Read 1017 times)

workingmatt

  • EA User
  • **
  • Posts: 22
  • Karma: +0/-0
    • View Profile
Image In Model Addin Window
« on: May 01, 2024, 12:56:47 am »
I've created a C# AddIn that looks up an image path from a tagged value and displays the image in a dockable window. The image in the window changes when different elements are selected.

Now, I'd like to do the same, or similar, within a Model Addin. I can see how to add groups and text fields but not an image.

1) Is it possible in a Model Addin?
2) How can it be done?

My thoughts are there's an XML property of type=image. Perhaps I can use an image asset to link into that XML. Perhaps I can load the image from a local directory as I did with the C# addin.

Best Wishes,

Matt.

workingmatt

  • EA User
  • **
  • Posts: 22
  • Karma: +0/-0
    • View Profile
Re: Image In Model Addin Window
« Reply #1 on: May 02, 2024, 02:31:36 am »
I haven't been able to find any documentation on the XML properties used to set up a tab in an AddIn window. The following is the xml for a simple group with a text field:
Code: [Select]
<?xml version="1.0"?>
<properties>
<group name="group 1">
<property id="1" type="text" default="" readonly="false">
<name>TestText</name>
<description>this has id=1</description>
<value>Matt</value>
</property>
</group>
</properties>

I've tried type="image", but can't find parameters to replace name, description and value, or even if type=image can work. Trying ImageID for an image asset, filepath/filename of image. It would be nice to find some documentation on this - or an example that shows something other than text.

workingmatt

  • EA User
  • **
  • Posts: 22
  • Karma: +0/-0
    • View Profile
Re: Image In Model Addin Window
« Reply #2 on: May 02, 2024, 08:45:05 pm »
I have found some documentation with example code: https://sparxsystems.com/enterprise_architect_user_guide/15.2/automation/repository3.html

The xml property types for Addin Tabs found there are: text, combobox, date, checkbox, spin, double, and memo. They mostly have name, value, description fields in the property (some drop value, some add extras). These look like the predefined tagged value types one of which is ImageRef. This feels like a possible way forward.

shimon

  • EA User
  • **
  • Posts: 106
  • Karma: +3/-0
    • View Profile
Re: Image In Model Addin Window
« Reply #3 on: May 06, 2024, 03:32:44 pm »
Hi Matt,
This sounds very interesting. Are you willing to share your code?
We would like to have an alternate image for some classes (Vehicles, Devices or Sensors) but don't want them on all diagrams. We are not sure if there is a simple way to choose which image to display in any specific context.

Your solution sounds like an interesting alternative.

Sincerely,
Shimon.

workingmatt

  • EA User
  • **
  • Posts: 22
  • Karma: +0/-0
    • View Profile
Re: Image In Model Addin Window
« Reply #4 on: May 16, 2024, 01:58:38 am »
Hi Shimon,

I sent you a private message. In summary, I make my living in part by writing AddIns like this for other people. I'd be happy to do the same for you but alas I cannot share the code.