Get current scope in scripting

We’ve got this in a script called env

from com.inductiveautomation.ignition.common.model import ApplicationScope

scope = ApplicationScope.getGlobalScope()


def isDesigner():
	return ApplicationScope.isDesigner(scope)

def isGateway():
	return ApplicationScope.isGateway(scope)
	
def isPerspective():
	return ApplicationScope.isGateway(scope) and hasattr(system,'perspective')

def isVision():
	return ApplicationScope.isClient(scope)

Then call it with env.isGateway() etc…

3 Likes