Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: vignesh on September 25, 2017, 04:34:44 pm
-
I have created an add-in and added it to EA and its working fine and now i need to call the add-in when element is add or values of the element changed .If this is possible via trigger could you please give me a brief steps about how to do it.
Thanks in Advance.
-
EA will send out broadcasts when certain actions take place, so you need to create functions that respond to those broadcasts. For example, to respond to a new element being created, you will need to have a function called EA_OnPostNewElement. Search the help for "EA_OnPostNewElement" and it should point you in the right direction.
-
Thanks!!
Its really helpful..
I need to keep hold of the currently added element.Could you please help how to get it.
Thanks in Advance.
-
If you read the link for the operation KP mention you should know.
q.
-
I am getting index out of range error when i use the broadcast function as mentioned above.Is there any work around or direct solution for it?
Thanks in advance.
-
Without knowing what you have done there I would need to look into my glass bowl. Unfortunately I had to send it in for maintenance yesterday.
q.
-
Hi,
I would do:
- Check passed variables for 0/null
- Check variables for its values before using them
- Use a try {} catch {} block to handle exceptions
- Switch to DEBUG mode or use debug messages
Best regards,
Helmut
-
I have written the below mentioned code in EA_OnPostNewElement function and the error index out of range is prompted.
ElementID = int.Parse(info.Get("ID").Value);
DiagramID = int.Parse(info.Get("DiagramID").Value);
-
It's a long time since I wrote an add-in, but I don't think you're going to be passed a DiagramID in the EventProperties of EA_OnPostNewElement. Try getting the size of the EventProperties then loop through with Get(index) and see what's there - more reliable than guessing the property names.
-
There's no need to guess. The property names are all documented in the manual; you just have to read it.
Geert
-
There's no need to guess. The property names are all documented in the manual; you just have to read it.
Geert
Correct. I've just checked it's neither "ID" nor "DiagramID".
-
I need to get the name,type and etc from the newly created element in the EA_OnPostNewElement function is the possible??
Thanks in advance.
-
yes
-
How to fetch it?
Thanks in advance.
-
How to fetch it?
Thanks in advance.
Sorry vignesh, you'll have to find another victim to send you teh codez.
I'm not playing.
Geert