Book a Demo

Author Topic: MDG Technology - Default Appearance as Icon  (Read 5782 times)

rvi1cob

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
MDG Technology - Default Appearance as Icon
« on: June 08, 2016, 07:26:07 pm »
Hi Everyone,

I am new for developing MDG Technology, wondering to get some help.

I have to create custom elements for my project and below is the requirement. While creating new elements in the diagram, the element should pick-up a default icon for appearance.

This is what I tried, (as guideline)

1. Created a Stereotype for my metaclass
2. In the Option : Edit with profile helper -- Assigned - icon (16 x 16) and _metatype: block

After generating MDG file and importing my MDG Technology, I tried to create a new element in my MDG diagram, but found that

1. In the toolbox - icon is assigned
2. When I drag and drop the element to create one, it has the default box. But here the expectation is the custom icon.

Any guidance, what exactly should I do to acheive this?

Regards
Vijay

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: MDG Technology - Default Appearance as Icon
« Reply #1 on: June 08, 2016, 07:39:15 pm »
You need to create a shape script that will do the diagram rendering and assign it to the _image attribute. Just add an _image attribute and click the ellipsis button in the Initial Value. That lets you write the shape script.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: MDG Technology - Default Appearance as Icon
« Reply #2 on: June 08, 2016, 08:55:13 pm »
Using the profile helper you click on the shape script tab and the button Edit.

You can use an image in the schapescript as well.
Below is an example from one of my stereotypes:

Code: [Select]
shape main
{
DefSize(36,24);
SetPenWidth(1);
Rectangle(0,0,100,100);
image("BAM icon_dial",2,3,98,97);
}

The "BAM icon_dial" has to be imported in the image manager

Geert

rvi1cob

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: MDG Technology - Default Appearance as Icon
« Reply #3 on: June 08, 2016, 10:36:04 pm »
Hi Geert,

Thanks for the hint.
I tried in the shape editor and in the preview, it showed the desired icon.

But it is still not working, after generating new MDG and importing it.

Note: The default appearance setting is reflecting correctly when I drag and drop for creating new elements.

Any other settings that I should check.

Regards
Vijay

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: MDG Technology - Default Appearance as Icon
« Reply #4 on: June 08, 2016, 11:34:00 pm »
Make sure to include the image in the MDG as well.


Geert

rvi1cob

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: MDG Technology - Default Appearance as Icon
« Reply #5 on: June 08, 2016, 11:58:50 pm »
Yes. already included  :(




rvi1cob

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: MDG Technology - Default Appearance as Icon
« Reply #6 on: June 18, 2016, 12:40:26 am »
found the problem. It works only when the metaclass is of type "Class". I was using metaclass "Table".
Thanks for your hints.

Regards
Vijay