# Calling a class from a script

**URL:** <https://forum.inductiveautomation.com/t/calling-a-class-from-a-script/71225>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [March 17, 2023, 11:48am UTC](https://forum.inductiveautomation.com/t/calling-a-class-from-a-script/71225 "2023-03-17T11:48:44Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 17, 2023, 2:04pm UTC](https://forum.inductiveautomation.com/t/calling-a-class-from-a-script/71225/9 "2023-03-17T14:04:48Z")

</div>

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:

> [@Project Library Script Initialization Races](https://forum.inductiveautomation.com/t/project-library-script-initialization-races/98636):
>
> Are you annoyed by pseudo-random breakage in Ignition project library scripting? Odd top-level constants being garbled, or operations in the top level that have side effects running twice? Or more? Not happening much, but always around project edits, and sometimes even on gateway restart? Yeah, me too. frowning_face Poking around under the hood back in the spring, for a module development task, I ran across some problematic IA bytecode and pinged some people. But it went nowhere, as I co…

---

_[View the full topic](https://forum.inductiveautomation.com/t/calling-a-class-from-a-script/71225)._
