How to import SDK packages and how to use class and methods…I need any sample code.
In general, your script module will follow this pattern:
from com.inductiveautomation.path.to.some.package import SomeClass, SomeOtherClass
def myFunction():
# Use constructor
myInstance = SomeClass(arg1, arg2)
# Use static methods
singleton = SomeClass.get()
# Use instance methods
someResult = myInstance.someOperaton(arg1, arg2)
# Use fields and NetBeans properties and static fields
anotherResult = myInstance.field1 * myInstance.someProp + SomeOtherClass.CLASS_CONSTANT
myInstance.field2 = 42
return someResult