on 09-29-2016 9:55 AM
Hopefully this is a nice and easy question. I'm looking to call a global Extension function (and ideally a "method Script" function) from the "Edit/Run Script" functionality - basically I have custom functions within an extension and want to call that via automation. Aka not from within the context of the model, but from the "ActiveModel" context.
Dim Model
Set Model = ActiveModel
Model.EXTENSION.Procedure "Param1", "Param2
The goal is to automate calling some functions that have been coded within the XEM across a number of models. I have most of the parts all covered, but I'm stumbling on actually calling/invoking a function within the XEM - and I suspect it is easy once you know it. Obviously the above doesn't work, but any ideas or pointers would be gratefully received,
Many thanks - Gareth
Hi Gareth,
you can do this pretty easily. But there are two conditions which must be fullfilled.
1) The extension should be attached to the model, in which you want to use it.
2) You cannot call directly Global script function/procedure, but you have to call it through certain interface. So I recommend to create methods for the Model metaclass for example, which would do nothing but call your procedure defined in Global script.
The syntax is quite simple:
ActiveModel.ExecuteCustomMethod("ExtendedDefinition_1.MyMethodName")
Ondrej
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.