Get SampleDefinitionLocations through scripting 3.0

Overview

The following script helps you to access locations for the sample definition.

Applies To and Version Info

This feature applies to the SPC module and is available in version 3.8 and greater.

Scripting

If a location path is added to the SampleDefinitionLocation object, the following code can be used to get the paths so that the limits or other operations can be done.

Code
sampleDefName = 'Nonconformity'
sampleDefObj = system.mes.spc.definition.getSampleDefinition(sampleDefName)
locationProps = sampleDefObj.getAllSampleLocationProperties()
for locProp in locationProps:
	locationObj = locProp.getLocationLink().getMESObject()
	print locationObj.getEquipmentPath()


There are a variety of other settings available in the location property object.

Using dir(locProp) or use pprint(dir(locProp)) will give you the full list.

The properties you are looking at are the defaults for the sample definition (per location)