Prev Next

Edit Add-In Code

The Class 'Behavior' view provides a convenient view for editing the code associated with the behavioral features of your Class.

Access

Ribbon

Develop > Source Code > Behavior

Syntax Highlighting

The Class 'Behavior' view highlights code using the language assigned to the Class.  For Model Add-Ins, this should be JavaScript.

Retrieving return values in JavaScript

When handling a reception for an event with OUT/INOUT parameters, values must be read and assigned using the .val attribute of those parameters.

For example, to set the value of the TagValue parameter on the EA_OnElementTagEdit event:

     TagValue.val = "Hello World!"

Adding Operations

Right click on the Class node at the top of the Structure Tree to add a new operation.

All operations should be given names that are valid for Javascript functions.

All code written will be generated to a function on a JavaScript object. Therefore, to call any function you have written, you will need to prefix it with: this.

Learn more