Archi Forum

Archi Plug-ins => jArchi => Topic started by: DaveVint on November 15, 2019, 14:53:38 PM

Title: Finding a model in jArchi
Post by: DaveVint on November 15, 2019, 14:53:38 PM
Hi,

I have a model that I want to use as an ABB template for an adapted copy/clone run by a script. For the initial load I would prompt the user to find and load it using the window.promptOpenFile and model.load functions. However I can't figure out how to tell if the model is already loaded and if so, find it. Probably just my lack of JQuery/Javascript experience, but I would be grateful for any pointers!

Cheers,

Dave
Title: Re: Finding a model in jArchi
Post by: Phil Beauvoir on November 15, 2019, 17:12:20 PM
The model#load(path) method will simply return the reference to the model if it is already loaded (i.e. in the Models Tree) but there's currently no way to know what is loaded.

We could implement:

$.model.getLoadedModels()

and:

$.model.isModelLoaded(model)

In fact I've just written the code to do this. @JB what do you think?
Title: Re: Finding a model in jArchi
Post by: Jean-Baptiste Sarrodie on November 15, 2019, 20:37:54 PM
Hi,

This might be useful in some occasion. If you've implemented it, let's test it ;-)

Regards,

JB
Title: Re: Finding a model in jArchi
Post by: DaveVint on November 25, 2019, 11:39:32 AM
Thanks for the quick response both! I've been offline for a while, so couldn't reply. Look forward to getting access to this.
Title: Re: Finding a model in jArchi
Post by: DaveVint on January 16, 2020, 17:08:05 PM
Hi Guys,

Downloaded jArchi 0.7.0 with this included and works a dream. Thanks!

Dave