Book a Demo

Author Topic: EA_OnPostNewElement and nested elements  (Read 9395 times)

Sorno

  • EA User
  • **
  • Posts: 71
  • Karma: +0/-0
    • View Profile
EA_OnPostNewElement and nested elements
« on: April 03, 2014, 07:58:50 pm »
Hi,

In my addin I use EA_OnPostNewElement to automatically set stereotype and name of certain elements that are either invocation and property.  I have a few issues though with elements created as property.

First issue:
The  EA_OnPostNewElement is called twice, first without information of PropertyType (the value is 0). Then the dialog is shown and after that EA_OnPostNewElement is called for the second time (now with PropertyType set to correct elementID). Since I don't have the PropertyType the first time I can't identify the kind of element that is created and suppress the dialog accordingly.

Second issue:
If the new element (created as propety) is created as a subelement (dragged and dropped on a existing element) it's name isn't updated in the diagram nor in the browser. The stereotype is changed though. I find this odd since I change them at the same time.
Edit: In this case the  EA_OnPostNewElement is not called at first, instead the user dialog is shown and afterwards EA call EA_OnPostNewElement.

Code: [Select]
element.Stereotype = "UsedConfiguration";
element.Name = propertyType.Name;
element.Update();

 
Using EA 10.1009.

Thank you for your input!
Jonas
« Last Edit: April 03, 2014, 08:15:50 pm by Sorno »