If I have created a class and saved it into it's own script within Ignition Designer, can it be 'imported' from another script in the same way as you could when writing 'py' scripts (i.e. placing all py's in the same directory and simply using the import command against the 'py' file containing the class to gain access to the class)?
If so, what would the construct of the filename need to be in this instance?
Say, for example, I nested it within a different sub-directory of the script library away from the sub-directory within which my script was in, how could I point the import command to it?
I've been looking through the knowledgebase and at Inductive University and I'm struggling to find any reference to the use of home-brew classes within Ignition.
It seems to work just fine when placed within the script it's used....however, as my class has been designed for use in multiple different circumstances, I suppose it really should be imported when required only to keep the script I'm using it within clean.
While you are in the script project library where your class is defined, just right click on the class on the right-hand side of the editor and select copy path. That will show you the full path to the class which is how you can use it in other script packages etc.
Sorry, you should not use import with project library scripts. There are odd corner cases that can eat your lunch. Use the full path everywhere you need it.
Misordered/unordered script loading that leaves old old code alive in strange ways. Never really nailed down, but suspected to be an artifact of java multithreading with jython's import machinery. Virtually impossible to reliably repeat, which is why I don't trust it.
It doesn't happen if you always refer to other project scripts' objects with full paths, at least for first use in a function.
Edit: New bold above. Now nailed down to be a bug in Ignition's script library auto-import, with a work-around: