Author Topic: EA_OnElementTagEdit not triggering  (Read 2767 times)

Mauricio Moya (Arquesoft)

  • EA User
  • **
  • Posts: 340
  • Karma: +8/-4
  • EA Consulting and development in Spanish
    • View Profile
    • Arquehub Azure Module
EA_OnElementTagEdit not triggering
« on: February 24, 2023, 08:22:42 am »
I'm creating a Model Addin (Broadcast Events/Tagged Value Events/EA_OnElementTagEdit), so I want to it trigger when the user change any tag value.

I create everything as it is supposed:
-Imported the Tagged Value Events from the Wizard
-Create a TagValueControlAddin
-Added the reception for EA_OnElementTagEdit
-Edit the internal code for the reception
-Save
-Specialize/Manage Addins and Enabled + Assigned to a security group (I belong to the group) + checked load on startup
-Then save, restart EA and reopen the project
-verified that the addin is still enabled in the manage addins windows
-Then changed some tag values, added some tag values, edited tag values from a MDG, etc. Nothing happened

The following is the code in the reception:
Code: [Select]
Session.Prompt("HELLO WORLD",1);
What am I missing?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13240
  • Karma: +553/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: EA_OnElementTagEdit not triggering
« Reply #1 on: February 24, 2023, 09:21:36 am »
You might not have a Session object when running as a model addin.

Try writing to the output, or using a messagebox

Geert

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8061
  • Karma: +118/-20
    • View Profile
Re: EA_OnElementTagEdit not triggering
« Reply #2 on: February 27, 2023, 09:42:04 am »
I'm creating a Model Addin (Broadcast Events/Tagged Value Events/EA_OnElementTagEdit), so I want to it trigger when the user change any tag value.
Did you read the help for EA_OnElementTagEdit? Here's the first sentence.
Quote
EA_OnElementTagEdit is called when the user clicks the Browse. button for a Tagged Value of type AddinBroadcast on an element.

This broadcast happens only if you have a tagged value with the type AddinBroadcast. It does not happen 'when the user change any tag value'.

Mauricio Moya (Arquesoft)

  • EA User
  • **
  • Posts: 340
  • Karma: +8/-4
  • EA Consulting and development in Spanish
    • View Profile
    • Arquehub Azure Module
Re: EA_OnElementTagEdit not triggering
« Reply #3 on: March 02, 2023, 07:54:44 am »
This broadcast happens only if you have a tagged value with the type AddinBroadcast. It does not happen 'when the user change any tag value'.

Ok, I just realized that. So there's no way to capture the event of edition of a normal tag value, unfortunately. :(