Book a Demo

Author Topic: EXEC_ADD_IN  (Read 3556 times)

blawton

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
EXEC_ADD_IN
« on: February 22, 2012, 06:04:58 am »
Hi all,

I'm trying to use the EXEC_ADD_IN macro in the Code Template Editor ( http://www.sparxsystems.com/enterprise_architect_user_guide/modeling_languages/functionmacros.html ), but I can't figure out how to implement it in a C# addin. I've tried defining the function to be accessed in a few ways, the most obvious being:

Code: [Select]
public string getRequirementsList(EA.Repository repo, string[] args)
and

Code: [Select]
public object getRequirementsList(EA.Repository repo, object arghs)
but neither seems to even get called when I try to use the macro

Code: [Select]
$reqs = %EXEC_ADD_IN("My Addin", "getRequirementsList", opGUID)%
Anyone played with this before? Thanks for your help!

blawton

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: EXEC_ADD_IN
« Reply #1 on: February 23, 2012, 08:53:58 am »
Heard back from Sparx support and I was referencing the addin wrong in the macro -- you've got to use the full name as defined in the registry under HKEY_CURRENT_USER\Software\Sparx Systems\EAAddins . Don't know why I thought the regular name would work!

blawton

  • EA Novice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: EXEC_ADD_IN
« Reply #2 on: February 24, 2012, 05:37:22 am »
Additionally the

Code: [Select]
public object getRequirementsList(EA.Repository repo, object arghs)

Is the correct constructor, after which your arguments should be cast into an array of strings (string[]).