Skip to content
Create global funct...
 
Notifications
Clear all

Create global function

5 Posts
4 Users
0 Reactions
1,648 Views
Avatar
Posts: 8
Customer
Topic starter
(@agy79a6q5vx0nbjjxy0vsixsg9b3)
Active Member
Joined: 3 years ago

I have a function within a model. How do I export that to be a function usable in other models?  I have the function within an exisitng modl. I put it in a module and set the model's class to Filed module. Now what?  

4 Replies
Mitzu Ganley
Posts: 11
Admin
(@mitzu-ganley)
Member
Joined: 3 years ago

Hello Paul, 

Thanks for reaching out and sharing your question. Here is a note from our developers:

You did exactly the right thing -- i.e., you placed the function in a module and then changed it to be a Filed Module.  Because it contains a function, "Filed Library" would match the intent a bit better, but a Filed Module works fine. 
 
So what you now need to do is this... In your other model, where you want to use the function, select "Add Module..." on the File menu while in Edit mode, and click on the Filed Module file. It'll ask whether you want to link or embed. You'll probably want to link. The function will now be available.
 
Note: You can use "Add Module..." or "Add Library..." to do this. They are functionally identical, the only difference being that the folder that the file selector dialog opens to initially.
Hope this helps. If not, please reach back out and we will continue to assist.
 
Happy modeling! 
 
Best,
Mg
Reply
Avatar
Posts: 8
Customer
Topic starter
(@agy79a6q5vx0nbjjxy0vsixsg9b3)
Active Member
Joined: 3 years ago

Thanks. The new function I had created was part of an existing model.  I needed to save-as to the name of the intended function (new_function.ana) and then delete all elements of the model except the filed module with the function.  Then I could do as you suggested to use the new function in other models.  Works like a charm.

Reply
Mitzu Ganley
Posts: 11
Admin
(@mitzu-ganley)
Member
Joined: 3 years ago

Awesome - glad it worked for you! 

Reply
Lonnie Chrisman
Posts: 42
Admin
(@lchrisman)
Member
Joined: 14 years ago

Glad you got it to work.

Your original posting said that you "put it in a module and set the model's class to Filed module."  You should have changed the module's class to Filed module (not the top-level model's class). It will ask you for a file name for the filed module. That will save you  next time from the step of having to "delete all elements of the model except the filed module with the function."  

Reply
Share:

Download the free edition of Analytica

The free version of Analytica lets you create and edit models with up to 101 variables, which is pretty substantial since each variable can be a multidimensional array. It also lets you run larger modes in ‘browse mode.’ Learn more about the free edition.

While Analytica doesn’t run on macOS, it does work with Parallels or VMWare through Windows.


    Analytica Cubes Pattern

    Download the free edition of Analytica

    The free version of Analytica lets you create and edit models with up to 101 variables, which is pretty substantial since each variable can be a multidimensional array. It also lets you run larger modes in ‘browse mode.’ Learn more about the free edition.

    While Analytica doesn’t run on macOS, it does work with Parallels or VMWare through Windows.


      Analytica Cubes Pattern