Python Command: Inspection

The Inspection commands in Python let you modify a running inspection. These commands only function while a Formula test is running in a sub-inspection.

Some commands apply to a test on the current sub-inspection, while others apply to the entire inspection or sub-inspection.

 

Contents  [Hide]

 

Test-specific commands

These commands affect a specific test on the current sub-inspection.

Checkbox test

Syntax

Example

Description/Remarks

New or
changed
in version

inspect.cursubi.checkbox(idx).custompassword

where idx is the TestID property of the test

inspect.cursubi.checkbox(0).custompassword = "P@$$w0rd"

Gets or sets the Custom Password property of this test.

9.2

inspect.cursubi.checkbox(idx).electronicsignaturetype

where idx is the TestID property of the test

inspect.cursubi.checkbox(0).electronicsignaturetype = 1

Gets or sets the ElectronicSignatureType property of this test.

Valid options are:

0 : UserNameAndPassword

1 : Level1Password

2 : Level2Password

3 : CustomPassword

9.2

inspect.cursubi.checkbox(idx).enabled

where idx is the TestID property of the test.

inspect.cursubi.checkbox(0).enabled = False

Gets or sets whether this Checkbox test will be enabled or disabled from user interaction ("grayed out").

Valid options are True (enabled, the default) and False (disabled).

Whether enabled or disabled: the test is visible to the inspector, the value of the test can be set through Python code, and the value of the test is stored when the sub-inspection is submitted. If the test is required but does not have a value, the sub-inspection cannot be submitted.

Disabling a test lets you set its value and store the test without allowing the inspector to change its value. If you don't want to store the test, use inspect.cursubi.checkbox(idx).visible.

 

inspect.cursubi.checkbox(idx).eventdms

where idx is the TestID property of the test.

inspect.cursubi.checkbox(0).eventdms = "New raw material lot"

Gets/Sets the DMS Event field for this test only.

When setting this field, you must specify the DMS Event description, not the 1-digit short code for the DMS Event. The value must already exist in the DMS Event list or it is ignored.

For this test, this DMS Event overrides a DMS Event test on the sub-inspection.

9.1

inspect.cursubi.checkbox(idx).extratrace

where idx is the TestID property of the test

inspect.cursubi.checkbox(0).extratrace = 8

Gets or sets the ExtraTrace property of this test.

A number from 1 to the maximum traceability field number. Set to 0 to clear this property.

If this test's Response property is set to anything other than Okay and this property is not set, an error will occur.

9.2

inspect.cursubi.checkbox(idx).focus()

where idx is the TestID property of the test.

inspect.cursubi.checkbox(0).focus()

Sets the focus to the checkbox test with TestID 0.

Sets the focus to this test (as if the user had pressed the Tab key to move the focus to this test) after the Python script completes.

When one script executes this .focus() method for multiple tests, the focus will be set to the last test for which .focus() was executed.

Common practice is to execute this command in a Formula test with the FormulaMode property set to Pre, which sets the focus to a particular test when the sub-inspection opens.

9.2

inspect.cursubi.checkbox(idx).gettrace(index)

where idx is the TestID property of the test

and index is the traceability field number.

inspect.cursubi.checkbox(0).gettrace(3)

Gets the value of traceability field 3 that was set for this test only by executing the inspect.cursubi.checkbox(0).settrace(3, value) command or by setting the TestSpecificTrace property for this test.

Gets the value of a traceability field that was set for this test only by executing the corresponding inspect.cursubi.checkbox(idx).settrace command or by setting the TestSpecificTrace property for this test.

8.7

inspect.cursubi.checkbox(idx).label

where idx is the TestID property of the test.

inspect.cursubi.checkbox(0).label = "Visual check performed"

Gets or sets the Label property of this test.

Use None for a blank Label property.

9.2

inspect.cursubi.checkbox(idx).required

where idx is the TestID property of the test.

inspect.cursubi.checkbox(0).required = True

Sets the EntryRequired Checkbox test property to true.

Gets or sets the value of the EntryRequired Checkbox test property.

8.7

inspect.cursubi.checkbox(idx).response

where idx is the TestID property of the test

inspect.cursubi.checkbox(0).response = 1

Gets or sets the Response property of this test.

Valid options are:

0 : Okay

1 : Initials

2 : DatePick

3 : ElectronicSignature

If set to 1, 2, or 3, the ExtraTrace property must also be set.

9.2

inspect.cursubi.checkbox(idx).samplesize

where idx is the TestID property of the test

inspect.cursubi.checkbox(0).samplesize = 25

Gets or sets the SampleSize property of this test.

The value must be greater than or equal to 0.

9.2

inspect.cursubi.checkbox(idx).settrace(index, value)

where idx is the TestID property of the test

and index is the traceability field number.

inspect.cursubi.checkbox(0).settrace(3, "E1403")

Sets traceability field 3 to "E1403" for this test only.

Sets the value of a traceability field for this test only.

Takes precedence over all other methods that might set this traceability value (e.g., value pre-filled by inspection or planned inspection, value entered by user, value set by other Python commands, test-specific properties that might set this traceability value, etc.).

Value is automatically cleared from the current traceability buffer after the sub-inspection is submitted or cancelled.

8.7

inspect.cursubi.checkbox(idx).texttostore

where idx is the TestID property of the test

inspect.cursubi.checkbox(0).texttostore = "Visual check"

Gets or sets the TextToStore property of this test.

9.2

inspect.cursubi.checkbox(idx).value

where idx is the TestID property of the test.

inspect.cursubi.checkbox(0).value = True

Sets the checkbox test status to checked.

Gets or sets the check status of the test. True is checked, False is unchecked.

 

inspect.cursubi.checkbox(idx).verticalsize

where idx is the TestID property of the test.

inspect.cursubi.checkbox(0).verticalsize = 1

This sets the display height of the Checkbox test to Short.

Gets or sets the display height of the test.

Valid options are 0 (Regular) and 1 (Short).

9.1

inspect.cursubi.checkbox(idx).visible

where idx is the TestID property of the test.

inspect.cursubi.checkbox(0).visible = False

This sets the Checkbox test to 'not visible'.

Gets or sets whether the Checkbox test will be visible.

Valid options are True (visible) and False (not visible).

If not visible:

  • The inspector cannot interact with this test.

  • No data will be stored for this test when the sub-inspection is submitted.

  • If this test is required, the sub-inspection can be submitted even if no value has been set for this test.

9.1

Date/Time test

Syntax

Example

Description/Remarks

New or
changed
in version

inspect.cursubi.datetime(idx).datetime

where idx is the TestID property of the test.

inspect.cursubi.datetime(0).datetime = 20180101165959333

This sets the Date/Time test to display January 1, 2018 at 4:59 PM. (Display formatting my vary based on the Region settings for the workstation.)

Gets or sets the date/time displayed for this test.

Return value is a 17-digit integer. To convert that value to a readable date/time string, use the hsidate.formatdbdate command.

To set this value, specify a 17-digit integer that represents the desired date/time stamp. To convert a readable date/time string to this integer format, use the hsidate.format_to_db command.

 

inspect.cursubi.datetime(idx).enabled

where idx is the TestID property of the test.

inspect.cursubi.datetime(0).enabled = False

Gets or sets whether this Date/Time test will be enabled or disabled from user interaction ("grayed out").

Valid options are True (enabled, the default) and False (disabled).

Whether enabled or disabled: the test is visible to the inspector, the value of the test can be set through Python code, and the value of the test is stored when the sub-inspection is submitted. If the test is required but does not have a value, the sub-inspection cannot be submitted.

Disabling a test lets you set its value and store the test without allowing the inspector to change its value. If you don't want to store the test, use inspect.cursubi.datetime(idx).visible.

 

inspect.cursubi.datetime(idx).focus()

where idx is the TestID property of the test.

inspect.cursubi.datetime(0).focus()

Sets the focus to the Date/Time test with TestID 0.

Sets the focus to this test (as if the user had pressed the Tab key to move the focus to this test) after the Python script completes.

When one script executes this .focus() method for multiple tests, the focus will be set to the last test for which .focus() was executed.

Common practice is to execute this command in a Formula test with the FormulaMode property set to Pre, which sets the focus to a particular test when the sub-inspection opens.

9.2

inspect.cursubi.datetime(idx).label

where idx is the TestID property of the test.

inspect.cursubi.datetime(0).label = "Current Date"

This sets the Date/Time test label to 'Current Date'.

Gets or sets the label displayed to the inspector for this test.

Use None for a blank Label property.

9.2

inspect.cursubi.datetime(idx).required

where idx is the TestID property of the test.

inspect.cursubi.datetime(idx).required = True

This sets the Date/Time test 'Required' property to True and forces the inspector to change this test's value before they can Submit the current sub-inspection.

Gets or sets the Required property for this test.

If this test's ForceCurrent property is set to False, changing its Required property from False to True will invalidate the current value of the test and forces the inspector to change this test's value before they can Submit the current sub-inspection.

9.3.2

inspect.cursubi.datetime(idx).visible

where idx is the TestID property of the test.

inspect.cursubi.datetime(0).visible = False

This sets the Date/Time test to 'not visible'.

Gets or sets whether the Date/Time test will be visible.

Valid options are True (visible) and False (not visible).

If not visible:

  • The inspector cannot interact with this test.

  • No data will be stored for this test when the sub-inspection is submitted.

  • If this test is required, the sub-inspection can be submitted even if no value has been set for this test.

9.1

Defect List test

Syntax

Example

Description/Remarks

New or
changed
in version

inspect.cursubi.defectlist(idx).autosumncus

where idx is the TestID property of the test.

inspect.cursubi.defectlist(0).autosumncus = True

Gets or sets the AutoSumNCUs property of this test.

If set to True, the NCU box is disabled and the NCU value is automatically calculated.

9.2

inspect.cursubi.defectlist(idx).buttonmode

where idx is the TestID property of the test.

inspect.cursubi.defectlist(0).buttonmode = 0

Gets or sets the ButtonMode property of this test.

0 : Count

1 : Multi-select

2 : Single-select

Changing this value will clear any defects already selected.

9.2

inspect.cursubi.defectlist(idx).defects

where idx is the TestID property of the test.

inspect.cursubi.defectlist(0).defects = ["Broken", "Burned"]

Sets the available defects in the Defect List to "Broken" and "Burned".

Gets or sets defect names in the Defect List test.

Any defect names that do not exist in GainSeeker will be ignored.

 

inspect.cursubi.defectlist(idx).enabled

where idx is the TestID property of the test.

inspect.cursubi.defectlist(0).enabled = False

Gets or sets whether this Defect List test will be enabled or disabled from user interaction ("grayed out").

Valid options are True (enabled, the default) and False (disabled).

Whether enabled or disabled: the test is visible to the inspector, the value of the test can be set through Python code, and the value of the test is stored when the sub-inspection is submitted. If the test is required but does not have a value, the sub-inspection cannot be submitted.

Disabling a test lets you set its value and store the test without allowing the inspector to change its value.

 

inspect.cursubi.defectlist(idx).enablesamplesizeandncu

where idx is the TestID property of the test.

inspect.cursubi.defectlist(0).enablesamplesizeandncu = True

Gets or sets the EnableSampleSizeAndNCU property of this test.

If the AutoSumNCUs property is set to True, the NCU box is disabled regardless of this value.

9.2

inspect.cursubi.defectlist(idx).eventdms

where idx is the TestID property of the test.

inspect.cursubi.defectlist(0).eventdms = "New raw material lot"

Gets/Sets the DMS Event field for this test only.

When setting this field, you must specify the DMS Event description, not the 1-digit short code for the DMS Event. The value must already exist in the DMS Event list or it is ignored.

For this test, this DMS Event overrides a DMS Event test on the sub-inspection.

9.1

inspect.cursubi.defectlist(idx).focus()

where idx is the TestID property of the test.

inspect.cursubi.defectlist(0).focus()

Sets the focus to the Defect List test with TestID 0.

Sets the focus to this test (as if the user had pressed the Tab key to move the focus to this test) after the Python script completes.

When one script executes this .focus() method for multiple tests, the focus will be set to the last test for which .focus() was executed.

Common practice is to execute this command in a Formula test with the FormulaMode property set to Pre, which sets the focus to a particular test when the sub-inspection opens.

9.2

inspect.cursubi.defectlist(idx).getforcenote()

where idx is the TestID property of the test.

inspect.cursubi.defectlist(idx).getforcenote()

Gets the ForceNote property for this test.

Gets the ForceNote property for this test.

This property determines whether to require entry of notes and/or corrective actions when a defect is present on this test.

Return value is a list in the format [ecat, note].

ecat will be one of these:

note will be either True (require Note entry) or False (do not require Note entry). If ecat is -1 (use the sub-inspection ForceNote property), this reflects the setting from the sub-inspection.

9.1

inspect.cursubi.defectlist(idx).gettrace(index)

where idx is the TestID property of the test

and index is the traceability field number.

inspect.cursubi.defectlist(0).gettrace(3)

Gets the value of traceability field 3 that was set for this test only by executing the inspect.cursubi.defectlist(0).settrace(3, value) command or by setting the TestSpecificTrace property for this test.

Gets the value of a traceability field that was set for this test only by executing the corresponding inspect.cursubi.defectlist(idx).settrace command or by setting the TestSpecificTrace property for this test.

8.7

inspect.cursubi.defectlist(idx).getvalue(index)

where idx is the TestID property of the test and where index is the index of the defect in the list of defects for the test.

print inspect.cursubi.defectlist(0).getvalue(0)

Prints the count of the first defect in the Defect List.

Returns the count of the defect at the specified index, with 0 being the first defect in the Defect List.

 

inspect.cursubi.defectlist(idx).label

where idx is the TestID property of the test.

inspect.cursubi.defectlist(0).label = "Select the Defects"

Gets or sets the Label property of this test.

Use None for a blank Label property.

9.2

inspect.cursubi.defectlist(idx).ncu

where idx is the TestID property of the test.

inspect.cursubi.defectlist(0).ncu = 2

Sets the number of non-conforming units of the test to 2.

Gets or sets the non-conforming units of the Defect List.

 

inspect.cursubi.defectlist(idx).note

where idx is the TestID property of the test.

inspect.cursubi.defectlist(0).note = "My note"

Sets the note for this test.

Gets or sets the note for this Defect List test.

 

inspect.cursubi.defectlist(idx).overrideprocess

where idx is the TestID property of the test.

inspect.cursubi.defectlist(0).overrideprocess = "B-Mixing"

Sets the Defects property to use the process "B-Mixing" for displaying defects and storing data for this test.

Gets or sets the portion of the Defects property that uses a specific Process for displaying defects and storing data for this Defect List test - regardless of the Process set for the Inspection (or Planned Inspection).

 

inspect.cursubi.defectlist(idx).requiredefect

where idx is the TestID property of the test.

inspect.cursubi.defectlist(0).requiredefect = True

Gets or sets the RequireDefect property of this test.

If set to True, the sub-inspection cannot be submitted unless a defect has been entered.

9.2

inspect.cursubi.defectlist(idx).samplesize

where idx is the TestID property of the test.

inspect.cursubi.defectlist(0).samplesize = 5

Sets the sample size of the test to 5.

Gets or sets the sample size of the Defect List.

 

inspect.cursubi.defectlist(idx).setforcenote(ecat, note)

where idx is the TestID property of the test.

inspect.cursubi.defectlist(0).setforcenote(-1)

Sets this test to use the sub-inspection ForceNote property.

inspect.cursubi.defectlist(0).setforcenote(1, True)

Inspector will be required to enter an Event and a Note when a defect is present for this test.

Sets the ForceNote property for this test.

This property determines whether to require entry of notes and/or corrective actions when a defect is present on this test.

ecat must be one of these:

For the note parameter:

  • If ecat is -1 (use the sub-inspection ForceNote property), the note is ignored and can be omitted.

  • If ecat is anything else:

    • To require Note entry, specify True for this parameter.

    • To specify that Note entry is not required, you can omit this parameter or specify False .

9.1

inspect.cursubi.defectlist(idx).settrace(index, value)

where idx is the TestID property of the test

and index is the traceability field number.

inspect.cursubi.defectlist(0).settrace(3, "E1403")

Sets traceability field 3 to "E1403" for this test only.

Sets the value of a traceability field for this test only.

Takes precedence over all other methods that might set this traceability value (e.g., value pre-filled by inspection or planned inspection, value entered by user, value set by other Python commands, test-specific properties that might set this traceability value, etc.).

Value is automatically cleared from the current traceability buffer after the sub-inspection is submitted or cancelled.

8.7

inspect.cursubi.defectlist(idx).setvalue(index, value)

where idx is the TestID property of the test and where index is the index of the defect in the list of defects for the test.

inspect.cursubi.defectlist(0).setvalue(0, 5)

Sets the count of the first defect to 5 in the Defect List.

Sets the count of the defect at the specified index to the count of value, with 0 being the index of the first defect.

The defect count can be set to a value greater than 1, even when the test's ButtonMode property is SingleSelect or MultiSelect.

 

inspect.cursubi.defectlist(idx).visible

where idx is the TestID property of the test.

inspect.cursubi.defectlist(0).visible = False

This sets the Defect List test to 'not visible'.

Gets or sets whether the Defect List test will be visible.

Valid options are True (visible) and False (not visible).

If not visible:

  • The inspector cannot interact with this test.

  • No data will be stored for this test when the sub-inspection is submitted.

  • If this test is required, the sub-inspection can be submitted even if no value has been set for this test.

9.3

DMS Standard test

Syntax

Example

Description/Remarks

New or
changed
in version

inspect.cursubi.dmspart(idx).enabled

where idx is the TestID property of the test.

inspect.cursubi.dmspart(0).enabled = False

Gets or sets whether this DMS Standard test will be enabled or disabled from user interaction ("grayed out").

Valid options are True (enabled, the default) and False (disabled).

Whether enabled or disabled: the test is visible to the inspector, the value of the test can be set through Python code, and the value of the test is stored when the sub-inspection is submitted. If the test is required but does not have a value, the sub-inspection cannot be submitted.

Disabling a test lets you set its value and store the test without allowing the inspector to change its value.

 

inspect.cursubi.dmspart(idx).focus()

where idx is the TestID property of the test.

inspect.cursubi.dmspart(0).focus()

Sets the focus to the DMS Standard test with TestID 0.

Sets the focus to this test (as if the user had pressed the Tab key to move the focus to this test) after the Python script completes.

When one script executes this .focus() method for multiple tests, the focus will be set to the last test for which .focus() was executed.

Common practice is to execute this command in a Formula test with the FormulaMode property set to Pre, which sets the focus to a particular test when the sub-inspection opens.

9.2

inspect.cursubi.dmspart(idx).partnumber

where idx is the TestID property of the test.

inspect.cursubi.dmspart(0).partnumber = "A-50 INSERT"

Gets or sets the DMS part number displayed on this test. This property has the same behavior as interactively setting a value in this test.

To clear any existing value from this test, set this to None.

8.7

inspect.cursubi.dmspart(idx).visible

where idx is the TestID property of the test.

inspect.cursubi.dmspart(0).visible = False

This sets the DMS Standard test to 'not visible'.

Gets or sets whether the DMS Standard test will be visible.

Valid options are True (visible) and False (not visible).

If not visible:

  • The inspector cannot interact with this test.

  • No data will be stored for this test when the sub-inspection is submitted.

  • If this test is required, the sub-inspection can be submitted even if no value has been set for this test.

If no DMS Standard is set because the DMS Standard test is not visible, any sub-inspection that attempts to store a DMS data record will display an error saying that no DMS Standard has been set.

9.3

Formula test

These commands are only used for a Formula test with FormulaMode set to Click.

Syntax

Example

Description/Remarks

New or
changed
in version

inspect.cursubi.formula(idx).color

where idx is the TestID property of the test.

inspect.cursubi.formula(0).color = "Red"

Sets the Formula button's background color to Red.

Gets or sets the background color for the Formula button.

You may specify the color's rgb (hex) value or its colorname. (For a full list of colornames - such as "red", "orange", "yellow", "green", "blue", "white", and many more - see https://www.colorcodehex.com/html-color-names.html or http://cng.seas.rochester.edu/CNG/docs/x11color.html.) The best practice is to set this to a color different from the forecolor (below) so the text is readable.

To clear the background color, set this to None or a blank string.

9.2

inspect.cursubi.formula(idx).enabled

where idx is the TestID property of the test.

inspect.cursubi.formula(0).enabled = False

Gets or sets whether this Formula button will be enabled or disabled from user interaction ("grayed out").

Valid options are True (enabled, the default) and False (disabled).

Whether enabled or disabled: the test is visible to the inspector, and the properties of the test can be set through Python code.

Disabling a test lets you show the button without allowing the inspector to click it. If you don't want the inspector to see the button, use inspect.cursubi.formula(idx).visible

9.2

inspect.cursubi.formula(idx).forecolor

where idx is the TestID property of the test.

inspect.cursubi.formula(0).color = "Black"

inspect.cursubi.formula(0).forecolor = "White"

Sets the Formula button's background color to Black and its foreground (font) color to White.

inspect.cursubi.formula(0).forecolor = "#00FF00"

Sets the Formula button's foreground (font) color to Lime.

Gets or sets the foreground (font) color for the Formula button.

You may specify the color's rgb (hex) value or its colorname. (For a full list of colornames - such as "red", "orange", "yellow", "green", "blue", "white", and many more - see https://www.colorcodehex.com/html-color-names.html or http://cng.seas.rochester.edu/CNG/docs/x11color.html.) The best practice is to set this to a color different from the background color (above) so the text is readable.

To clear the foreground color, set this to None or a blank string.

9.2

inspect.cursubi.formula(idx).focus()

where idx is the TestID property of the test.

inspect.cursubi.formula(0).focus()

Sets the focus to the Formula test with TestID 0.

Sets the focus to this test (as if the user had pressed the Tab key to move the focus to this test) after the Python script completes.

When one script executes this .focus() method for multiple tests, the focus will be set to the last test for which .focus() was executed.

Common practice is to execute this command in a Formula test with the FormulaMode property set to Pre, which sets the focus to a particular test when the sub-inspection opens.

9.2

inspect.cursubi.formula(idx).label

where idx is the TestID property of the test.

inspect.cursubi.formula(0).label = "Click to calculate values"

Gets or sets the Label property of this test.

Use None for a blank Label property.

9.2

inspect.cursubi.formula(idx).labelwhilerunning

where idx is the TestID property of the test.

inspect.cursubi.formula(0).labelwhilerunning = "Click to stop reading"

Gets or sets the RunningLabel property of this test.

Use None for a blank RunningLabel property.

9.3

inspect.cursubi.formula(idx).verticalsize

where idx is the TestID property of the test.

inspect.cursubi.formula(0).verticalsize = 1

Gets or sets the VerticalSize property of this test.

Valid options are 0 (Regular) and 1 (Short).

9.2

inspect.cursubi.formula(idx).visible

where idx is the TestID property of the test.

inspect.cursubi.formula(0).visible = False

Gets or sets whether the Formula button will be visible.

Valid options are True (visible) and False (not visible).

9.2

Numeric Input test

Syntax

Example

Description/Remarks

New or
changed
in version

inspect.cursubi.ni(idx).actiontaken

where idx is the TestID property of the test.

inspect.cursubi.ni(0).actiontaken = "Replaced Fill Hose"

Gets/Sets the Action Taken field for this test only.

When setting this field, you must specify the Long Description for the Action Taken, not the Short Description. The value must already exist in the Action Taken list or it is ignored.

For this test, this Action Taken overrides an Action Taken test on the sub-inspection.

9.1

inspect.cursubi.ni(idx).anchorpoint

where idx is the TestID property of the test.

inspect.cursubi.ni(0).anchorpoint = True

Gets/Sets the Anchor Point field for this test only.

Valid options are True (test is marked as an Anchor Point) or False (test is not an Anchor Point).

If inspect.cursubi.anchorpoint is True, that sets the Anchor Point for the sub-inspection and overrides this test-specific setting.

9.1

inspect.cursubi.ni(idx).autosendrtfemail

where idx is the TestID property of the test.

inspect.cursubi.ni(0).autosendrtfemail = True

Gets or sets the AutoSendRTFEmail property for this test.

9.2

inspect.cursubi.ni(idx).cause

where idx is the TestID property of the test.

inspect.cursubi.ni(0).cause = "Fill Hose Plugged"

Gets/Sets the Cause field for this test only.

When setting this field, you must specify the Long Description for the Cause, not the Short Description. The value must already exist in the Cause list or it is ignored.

For this test, this Cause overrides a Cause test on the sub-inspection.

9.1

inspect.cursubi.ni(idx).celllabels

where idx is the TestID property of the test.

inspect.cursubi.ni(idx).celllabels = ["Cavity 1", "Cavity 2", "Cavity 3"]

Gets/Sets the list of labels to display for individual data cells in the Numeric Input test, such as the default list ["Data 1", "Data2", etc.] or a custom list like ["Cavity 1", "Cavity 2", etc.] .

8.8

inspect.cursubi.ni(idx).checkfailureresponse

where idx is the TestID property of the test.

inspect.cursubi.ni(idx).checkfailureresponse = "joanne@acme.com, andy@acme.com"

Gets or sets the CheckFailureResponse property for this Numeric Input test.

This can be set to a string of comma-delimited email addresses.

9.2

inspect.cursubi.ni(idx).deviceprofile

where idx is the TestID property of the test.

inspect.cursubi.ni(0).deviceprofile = "Acme Caliper on Com Port 3"

Gets/Sets the device profile currently associated with the numeric input test, None if keyboard entry.

 

inspect.cursubi.ni(idx).enabled

where idx is the TestID property of the test.

inspect.cursubi.ni(0).enabled = False

Gets or sets whether this Numeric Input test will be enabled or disabled from user interaction ("grayed out").

Valid options are True (enabled, the default) and False (disabled).

Whether enabled or disabled: the test is visible to the inspector, the value of the test can be set through Python code, and the value of the test is stored when the sub-inspection is submitted. If the test is required but does not have a value, the sub-inspection cannot be submitted.

Disabling a test lets you set its value and store the test without allowing the inspector to change its value. If you don't want to store the test, use inspect.cursubi.ni(idx).visible.

 

inspect.cursubi.ni(idx).eventspc

where idx is the TestID property of the test.

inspect.cursubi.ni(0).eventspc = "Changeover"

Gets/Sets the SPC Event field for this test only.

When setting this field, you must specify the Long Description for the SPC Event, not the Short Description. The value must already exist in the SPC Event list or it is ignored.

For this test, this SPC Event overrides an SPC Event test on the sub-inspection.

9.1

inspect.cursubi.ni(idx).filter

where idx is the TestID property of the test.

inspect.cursubi.ni(0).filter = "Machine 1400"

Sets this test's filter property to the saved filter named "Machine 1400"

 

These are examples of using SQL query syntax for Quick filters:

inspect.cursubi.ni(0).filter = "UDL3 = 'MOLDING'"

inspect.cursubi.ni(0).filter = "UDL3 <> 'MOLDING'"

inspect.cursubi.ni(0).filter = "UDL3 Not Like '%MOLDING%'

inspect.cursubi.ni(0).filter = "(UDL7 <> 'MOLDING' Or UDL7 Is NULL)"

inspect.cursubi.ni(0).filter = "(UDL7 Not Like '%MOLDING%' Or UDL7 Is NULL)"

inspect.cursubi.ni(0).filter = "UDL7 = ' '"

Gets/Sets the Filter property for this test only.

  • You can specify a saved SPC filter using the filter name.

  • You can set a Quick filter by using SQL query syntax.

  • For traceability fields 7 and higher, when querying for "not like" or "not equal", remember that you need to add "Or UDLx Is NULL" like the examples shown at left.

  • When filtering for a blank traceability value, the Quick filter must filter for a space (not an empty string) like the example shown at left.

9.3

inspect.cursubi.ni(idx).focus()

where idx is the TestID property of the test.

inspect.cursubi.ni(0).focus()

Sets the focus to the first data entry cell in the Numeric Input test with TestID 0.

Sets the focus to the first data entry cell in this test (as if the user had pressed the Tab key to move the focus to this test) after the Python script completes.

When one script executes this .focus() method for multiple tests, the focus will be set to the last test for which .focus() was executed.

Common practice is to execute this command in a Formula test with the FormulaMode property set to Pre, which sets the focus to a particular test when the sub-inspection opens.

9.2

inspect.cursubi.ni(testid).focuscell(idx)

inspect.cursubi.ni(2).focuscell(3)

Sets the focus to the fourth data entry cell in the Numeric Input test with TestID 2.

Sets the focus to the specified data entry cell in this Numeric Input test after the Python script completes.

idx must be the index of the data entry cell that should receive focus, with 0 being the first data entry cell in the subgroup. For example, to put focus in data entry cell 5, you should specify an idx of 4.
If you specify an idx outside the subgroup size of this Numeric Input test, this command will generate an error.

9.3.2

inspect.cursubi.ni(idx).getforcenote()

where idx is the TestID property of the test.

inspect.cursubi.ni(idx).getforcenote()

Gets the ForceNote property for this test.

Gets the ForceNote property for this test.

This property determines whether to require entry of notes and/or corrective actions when there is a real-time failure on this test.

Return value is a list in the format [ecat, note].

ecat will be one of these:

  • -1 - Use the sub-inspection ForceNote property.

  • 0 - No corrective actions are required.

  • The sum of the individual corrective actions required:

    • 1 - Event

    • 2 - Cause

    • 4 - Action Taken

    • For example, when both Cause and Action Taken are required, ecat will be 6 (2 for Cause + 4 for Action Taken)

  • 8 - At least one of Event, Cause, or Action Taken is required.

note will be either True (require Note entry) or False (do not require Note entry). If ecat is -1 (use the sub-inspection ForceNote property), this reflects the setting from the sub-inspection.

9.1

inspect.cursubi.ni(idx).getrtfnote()

where idx is the TestID property of the test.

inspect.cursubi.ni(idx).getrtfnote()

Gets any real-time failure notes that were automatically generated during data collection for this numeric input test.

If there are no real-time failure notes, this returns None.

9.3

inspect.cursubi.ni(idx).gettrace(index)

where idx is the TestID property of the test

and index is the traceability field number.

inspect.cursubi.ni(0).gettrace(3)

Gets the value of traceability field 3 that was set for this test only by executing the inspect.cursubi.ni(0).settrace(3, value) command or by setting the TestSpecificTrace property for this test.

Gets the value of a traceability field that was set for this test only by executing the corresponding inspect.cursubi.ni(idx).settrace command or by setting the TestSpecificTrace property for this test.

8.7

inspect.cursubi.ni(idx).label

where idx is the TestID property of the test.

inspect.cursubi.ni("length").label = "Enter Length data"

inspect.cursubi.ni("weight").label = None

Gets or sets the label displayed to the inspector for this test.

Use None for a blank Label property.

 

inspect.cursubi.ni(idx).labelabovecell

where idx is the TestID property of the test.

inspect.cursubi.ni("weight").labelabovecell = True

If set to True, turns on the display of cell labels (Data 1, Data 2, etc., or custom labels set by inspect.cursubi.ni(idx).celllabels) above every cell. The larger Subgroup message will still be displayed above these cell labels.

Defaults to False.

8.8

inspect.cursubi.ni(idx).note

where idx is the TestID property of the test.

inspect.cursubi.ni(0).note = "My note"

Sets the note associated with this test.

Gets or sets the individual note for this numeric input test.

Does not include any real-time failure notes that were automatically generated during data collection.

If there is no individual note, this returns None.

9.3

inspect.cursubi.ni(idx).novaluemode

where idx is the TestID property of the test.

inspect.cursubi.ni("length").novaluemode = 2

Set the "No Value Mode" for this test to "DoNotStore".

Gets or sets the NoValue property for this numeric input test.

0 = RequireEntry, 1 = StoreSentinel, and 2 = DoNotStore.

 

inspect.cursubi.ni(idx).partno

where idx is the TestID property of the test.

inspect.cursubi.ni(0).partno = "Temp 1250"

Sets the part number associated with this test.

Gets or sets the part number associated with this numeric input test.

 

inspect.cursubi.ni(idx).rtfvalue

where idx is the TestID property of the test.

x = inspect.cursubi.ni(7).rtfvalue & 1024

if x == 1024:

print "Data above spec"

Prints a message if the Numeric Input test with TestID 7 failed the Upper Spec Limit.

Returns a number representing the combined real-time failures for the specified Numeric Input test.

For a reference of the failures represented by the returned number, see Real-time Failure codes.

See also:

inspect.cursubi.gettesttype(idx)

inspect.cursubi.testidlist

 

inspect.cursubi.ni(idx).search

where idx is the TestID property of the test.

inspect.cursubi.ni(0).search = "Temp"

Sets the SPCStandardSearchString Numeric Input test property associated with this test.

Gets or sets the SPCStandardSearchString associated with this numeric input test.

 

inspect.cursubi.ni(idx).setforcenote(ecat, note)

where idx is the TestID property of the test.

inspect.cursubi.ni(0).setforcenote(-1)

Sets this test to use the sub-inspection ForceNote property.

inspect.cursubi.ni(0).setforcenote(8, True)

Sets the ForceNote property for this test.

    • Inspector will be required to enter at least one of Event, Cause, or Action Taken.

    • Inspector will be required to enter a Note.

Sets the ForceNote property for this test.

This property determines whether to require entry of notes and/or corrective actions when there is a real-time failure on this test.

ecat must be one of these:

  • -1 - Use the sub-inspection ForceNote property.

  • 0 - No corrective actions are required.

  • The sum of the individual corrective actions you want to require:

    • 1 - Event

    • 2 - Cause

    • 4 - Action Taken

    • For example, to require both Cause and Action Taken, specify an ecat of 6 (2 for Cause + 4 for Action Taken)

  • 8 - Require at least one of Event, Cause, or Action Taken.

For the note parameter:

  • If ecat is -1 (use the sub-inspection ForceNote property), the note is ignored and can be omitted.

  • If ecat is anything else:

    • To require Note entry, specify True for this parameter.

    • To specify that Note entry is not required, you can omit this parameter or specify False .

9.1

inspect.cursubi.ni(idx).settrace(index, value)

where idx is the TestID property of the test

and index is the traceability field number.

inspect.cursubi.ni(0).settrace(3, "E1403")

Sets traceability field 3 to "E1403" for this test only.

Sets the value of a traceability field for this test only.

Takes precedence over all other methods that might set this traceability value (e.g., value pre-filled by inspection or planned inspection, value entered by user, value set by other Python commands, test-specific properties that might set this traceability value, etc.).

Value is automatically cleared from the current traceability buffer after the sub-inspection is submitted or cancelled.

8.7

inspect.cursubi.ni(idx).solartronmoduleid

where idx is the TestID property of the test.

myvar = inspect.cursubi.ni(0).solartronmoduleid

Sets a variable (myvar) to the current value of the Module ID setting for this test's SolartronSettings property.

 

inspect.cursubi.ni(0).solartronmoduleid = "110A523P17"

Changes the Module ID setting for this test's SolartronSettings property to "110A523P17".

Gets or sets the Module ID setting for this test's SolartronSettings property.

This value is a string.

9.3

inspect.cursubi.ni(idx).subgroupcomplete

where idx is the TestID property of the test.

inspect.cursubi.ni(idx).subgroupcomplete

Checks whether all fields in the subgroup have been filled with either a number or * (missing data value). Returns True if subgroup is complete and False if any of the fields in the subgroup are empty.

 

inspect.cursubi.ni(idx).subgroupsize

where idx is the TestID property of the test.

print inspect.cursubi.ni(0).subgroupsize

Prints the subgroup size of the test.

Gets the subgroup size associated with this numeric input test.

If the SPCStandardSelection property of the Numeric Input test is set to DoNotStore, you can use this command to set the subgroup size (number of input boxes) for this Numeric Input test. Common practice is to execute this type of command in a Formula test with the FormulaMode property set to Pre.

Selecting the SPC standard ("part number") for the numeric input test will reset the subgroup size to the value in the standard.

 

inspect.cursubi.ni(idx).tabdirection

where idx is the TestID property of the test.

print inspect.cursubi.ni(0).tabdirection = 1

Sets the TabDirection property to Down.

Gets or sets the TabDirection property of this numeric input test.

Valid options are 0 (Across) and 1 (Down).

9.2

inspect.cursubi.ni(idx).values

where idx is the TestID property of the test.

inspect.cursubi.ni(0).values = [2.5, 12.4]

Sets the values associated with this test.

Gets or sets the values of each cell of this numeric input test as a list. The list length must match the number of cells in the test. Use None to clear the cell.

 

inspect.cursubi.ni(idx).verticalsize

where idx is the TestID property of the test.

inspect.cursubi.ni(0).verticalsize = 1

This sets the display height of the Numeric Input test to Short.

Gets or sets the display height of the test.

Valid options are 0 (Regular) and 1 (Short).

9.1

inspect.cursubi.ni(idx).visible

where idx is the TestID property of the test.

inspect.cursubi.ni("Length").visible = False

if inspect.cursubi.ni(0).visible == True:
  inspect.cursubi.text(4).text = "Begin test."

Gets or sets whether the Numeric Input test will be visible when running either an inspection or a planned inspection.

Valid options are True (visible) and False (not visible).

If not visible:

  • The inspector cannot interact with this test.

  • No data will be stored for this test when the sub-inspection is submitted.

  • If this test is required, the sub-inspection can be submitted even if no value has been set for this test.

If a planned inspection sets the numeric input test to be hidden, using this command to make this test visible will not display any charts configured for this test.

If the numeric input test is not hidden by a planned inspection, and the SPC standard has been set by either the inspection or a planned inspection, using this command to hide this test will not hide any charts configured for this test. This is true even if the command is triggered by a Pre script.

 

Pass/Fail/NA test

Syntax

Example

Description/Remarks

New or
changed
in version

inspect.cursubi.passfail(idx).defectname

where idx is the TestID property of the test.

inspect.cursubi.passfail(0).defectname = "Scratch"

Gets or sets the DefectName property of this test.

If the given defect does not exist, it will report an error when the script is executed.

9.2

inspect.cursubi.passfail(idx).enabled

where idx is the TestID property of the test.

inspect.cursubi.passfail(0).enabled = False

Gets or sets whether this Pass/Fail/NA test will be enabled or disabled from user interaction ("grayed out").

Valid options are True (enabled, the default) and False (disabled).

Whether enabled or disabled: the test is visible to the inspector, the value of the test can be set through Python code, and the value of the test is stored when the sub-inspection is submitted. If the test is required but does not have a value, the sub-inspection cannot be submitted.

Disabling a test lets you set its value and store the test without allowing the inspector to change its value. If you don't want to store the test, use inspect.cursubi.passfail(idx).visible.

 

inspect.cursubi.passfail(idx).eventdms

where idx is the TestID property of the test.

inspect.cursubi.passfail(0).eventdms = "New raw material lot"

Gets/Sets the DMS Event field for this test only.

When setting this field, you must specify the DMS Event description, not the 1-digit short code for the DMS Event. The value must already exist in the DMS Event list or it is ignored.

For this test, this DMS Event overrides a DMS Event test on the sub-inspection.

9.1

inspect.cursubi.passfail(idx).failcolor

where idx is the TestID property of the test.

inspect.cursubi.passfail(0).failcolor = "Red"

Gets or sets the FailColor property of this test.

Enter a RGB color number (such as "255,0,0"), HEX color number (such as "#ff0000"), or color name (such as "Red").

9.2

inspect.cursubi.passfail(idx).faillabel

where idx is the TestID property of the test.

inspect.cursubi.passfail(0).faillabel = "Pressure is low"

Gets or sets the ButtonFailLabel property of this test.

9.2

inspect.cursubi.passfail(idx).focus()

where idx is the TestID property of the test.

inspect.cursubi.passfail(0).focus()

Sets the focus to the Pass/Fail/NA test with TestID 0.

Sets the focus to this test (as if the user had pressed the Tab key to move the focus to this test) after the Python script completes.

When one script executes this .focus() method for multiple tests, the focus will be set to the last test for which .focus() was executed.

Common practice is to execute this command in a Formula test with the FormulaMode property set to Pre, which sets the focus to a particular test when the sub-inspection opens.

9.2

inspect.cursubi.passfail(idx).getforcenote()

where idx is the TestID property of the test.

inspect.cursubi.passfail(idx).getforcenote()

Gets the ForceNote property for this test.

Gets the ForceNote property for this test.

This property determines whether to require entry of notes and/or corrective actions when a defect is present on this test.

Return value is a list in the format [ecat, note].

ecat will be one of these:

note will be either True (require Note entry) or False (do not require Note entry). If ecat is -1 (use the sub-inspection ForceNote property), this reflects the setting from the sub-inspection.

9.1

inspect.cursubi.passfail(idx).gettrace(index)

where idx is the TestID property of the test

and index is the traceability field number.

inspect.cursubi.passfail(0).gettrace(3)

Gets the value of traceability field 3 that was set for this test only by executing the inspect.cursubi.passfail(0).settrace(3, value) command or by setting the TestSpecificTrace property for this test.

Gets the value of a traceability field that was set for this test only by executing the corresponding inspect.cursubi.passfail(idx).settrace command or by setting the TestSpecificTrace property for this test.

8.7

inspect.cursubi.passfail(idx).label

where idx is the TestID property of the test.

inspect.cursubi.passfail(0).label = "Pressure Check"

This sets the test label to 'Pressure Check'.

Gets or sets the Label property of this test.

Use None for a blank Label property.

9.2

inspect.cursubi.passfail(idx).nacolor

where idx is the TestID property of the test.

inspect.cursubi.passfail(0).nacolor = "Blue"

Gets or sets the NAColor property of this test.

Enter a RGB color number (such as "255,0,0"), HEX color number (such as "#ff0000"), or color name (such as "Red").

9.2

inspect.cursubi.passfail(idx).note

where idx is the TestID property of the test.

inspect.cursubi.passfail(0).note = "My note"

Sets the note for the test.

Gets or sets the note for the Pass/Fail/NA test.

 

inspect.cursubi.passfail(idx).passcolor

where idx is the TestID property of the test.

inspect.cursubi.passfail(0).passcolor = "Green"

Gets or sets the PassColor property of this test.

Enter a RGB color number (such as "255,0,0"), HEX color number (such as "#ff0000"), or color name (such as "Red").

9.2

inspect.cursubi.passfail(idx).passlabel

where idx is the TestID property of the test.

inspect.cursubi.passfail(0).passlabel = "Pressure is ok"

Gets or sets the ButtonPassLabel property of this test.

9.2

inspect.cursubi.passfail(idx).samplesize

where idx is the TestID property of the test.

inspect.cursubi.passfail(0).samplesize = 100

Gets or sets the SampleSize property of this test.

Sample size must be greater than or equal to 0.

9.2

inspect.cursubi.passfail(idx).setforcenote(ecat, note)

where idx is the TestID property of the test.

inspect.cursubi.passfail(0).setforcenote(-1)

Sets this test to use the sub-inspection ForceNote property.

inspect.cursubi.passfail(0).setforcenote(1, True)

Inspector will be required to enter an Event and a Note when a defect is present for this test.

Sets the ForceNote property for this test.

This property determines whether to require entry of notes and/or corrective actions when a defect is present on this test.

ecat must be one of these:

For the note parameter:

  • If ecat is -1 (use the sub-inspection ForceNote property), the note is ignored and can be omitted.

  • If ecat is anything else:

    • To require Note entry, specify True for this parameter.

    • To specify that Note entry is not required, you can omit this parameter or specify False .

9.1

inspect.cursubi.passfail(idx).setncu

where idx is the TestID property of the test.

inspect.cursubi.passfail(0).setncu = True

Gets or sets the SetNCU property of this test.

9.2

inspect.cursubi.passfail(idx).settrace(index, value)

where idx is the TestID property of the test

and index is the traceability field number.

inspect.cursubi.passfail(0).settrace(3, "E1403")

Sets traceability field 3 to "E1403" for this test only.

Sets the value of a traceability field for this test only.

Takes precedence over all other methods that might set this traceability value (e.g., value pre-filled by inspection or planned inspection, value entered by user, value set by other Python commands, test-specific properties that might set this traceability value, etc.).

Value is automatically cleared from the current traceability buffer after the sub-inspection is submitted or cancelled.

8.7

inspect.cursubi.passfail(idx).showna

where idx is the TestID property of the test.

inspect.cursubi.passfail(0).showna = True

Gets or sets the ShowNA property of this test.

9.2

inspect.cursubi.passfail(idx).value

where idx is the TestID property of the test.

inspect.cursubi.passfail(0).value = 1

Sets the test to "Fail".

Gets or sets the status of the Pass/Fail/NA test.

Valid options for this status are:

-1 = Not set (no button selected)

0 = Pass button selected

1 = Fail button selected

2 = N/A button selected (only valid if ShowNA = True, otherwise will display an error message)

8.9

inspect.cursubi.passfail(idx).verticalsize

where idx is the TestID property of the test.

inspect.cursubi.passfail(0).verticalsize = 1

This sets the display height of the Pass/Fail/NA test to Short.

Gets or sets the display height of the test.

Valid options are 0 (Regular) and 1 (Short).

9.1

inspect.cursubi.passfail(idx).visible

where idx is the TestID property of the test.

inspect.cursubi.passfail(0).visible = False

This sets the Pass/Fail/NA test to 'not visible'.

Gets or sets whether the Pass/Fail/NA test will be visible.

Valid options are True (visible) and False (not visible).

If not visible:

  • The inspector cannot interact with this test.

  • No data will be stored for this test when the sub-inspection is submitted.

  • If this test is required, the sub-inspection can be submitted even if no value has been set for this test.

9.1

Rating test

Syntax

Example

Description/Remarks

New or
changed
in version

inspect.cursubi.rating(idx).actiontaken

where idx is the TestID property of the test.

inspect.cursubi.rating(0).actiontaken = "Replaced Fill Hose"

Gets/Sets the Action Taken field for this test only.

When setting this field, you must specify the Long Description for the Action Taken, not the Short Description. The value must already exist in the Action Taken list or it is ignored.

For this test, this Action Taken overrides an Action Taken test on the sub-inspection.

9.1

inspect.cursubi.rating(idx).anchorpoint

where idx is the TestID property of the test.

inspect.cursubi.rating(0).anchorpoint = True

Gets/Sets the Anchor Point field for this test only.

Valid options are True (test is marked as an Anchor Point) or False (test is not an Anchor Point).

If inspect.cursubi.anchorpoint is True, that sets the Anchor Point for the sub-inspection and overrides this test-specific setting.

9.1

inspect.cursubi.rating(idx).cause

where idx is the TestID property of the test.

inspect.cursubi.rating(0).cause = "Fill Hose Plugged"

Gets/Sets the Cause field for this test only.

When setting this field, you must specify the Long Description for the Cause, not the Short Description. The value must already exist in the Cause list or it is ignored.

For this test, this Cause overrides a Cause test on the sub-inspection.

9.1

inspect.cursubi.rating(idx).datastorage

where idx is the TestID property of the test.

inspect.cursubi.rating(0).datastorage = 3

Sets this Rating test to store both SPC and DMS data.

myvar = inspect.cursubi.rating(0).datastorage

Sets the myvar variable to the value of the test's DataStorage property.

Gets or sets the DataStorage property for this test, which determines what type(s) of data will be stored.

Must be one of the following numbers:

0 = DoNotStore

1 = SPC

2 = DMS

3 = Both

9.1

inspect.cursubi.rating(idx).enabled

where idx is the TestID property of the test.

inspect.cursubi.rating(0).enabled = False

Gets or sets whether this Rating test will be enabled or disabled from user interaction ("grayed out").

Valid options are True (enabled, the default) and False (disabled).

Whether enabled or disabled: the test is visible to the inspector, the value of the test can be set through Python code, and the value of the test is stored when the sub-inspection is submitted. If the test is required but does not have a value, the sub-inspection cannot be submitted.

Disabling a test lets you set its value and store the test without allowing the inspector to change its value. If you don't want to store the test, use inspect.cursubi.rating(idx).visible.

9.1

inspect.cursubi.rating(idx).eventdms

where idx is the TestID property of the test.

inspect.cursubi.rating(0).eventdms = "New raw material lot"

Gets/Sets the DMS Event field for this test only.

When setting this field, you must specify the DMS Event description, not the 1-digit short code for the DMS Event. The value must already exist in the DMS Event list or it is ignored.

For this test, this DMS Event overrides a DMS Event test on the sub-inspection.

9.1

inspect.cursubi.rating(idx).eventspc

where idx is the TestID property of the test.

inspect.cursubi.rating(0).eventspc = "Changeover"

Gets/Sets the SPC Event field for this test only.

When setting this field, you must specify the Long Description for the SPC Event, not the Short Description. The value must already exist in the SPC Event list or it is ignored.

For this test, this SPC Event overrides an SPC Event test on the sub-inspection.

9.1

inspect.cursubi.rating(idx).focus()

where idx is the TestID property of the test.

inspect.cursubi.rating(0).focus()

Sets the focus to the Rating test with TestID 0.

Sets the focus to this test (as if the user had pressed the Tab key to move the focus to this test) after the Python script completes.

When one script executes this .focus() method for multiple tests, the focus will be set to the last test for which .focus() was executed.

Common practice is to execute this command in a Formula test with the FormulaMode property set to Pre, which sets the focus to a particular test when the sub-inspection opens.

9.2

inspect.cursubi.rating(idx).getcolor(value)

where idx is the TestID property of the test.

myvar = inspect.cursubi.rating(0).getcolor(5)

Sets the myvar variable to the color of the button with value 5.

For one Rating button, this returns the color that will be displayed when that button is selected.

value determines which button you are working with. Valid options are:

  • numeric value of the button: an integer from inspect.cursubi.rating(idx).min to inspect.cursubi.rating(idx).max

  • 10 = N/A button selected (only valid if inspect.cursubi.rating(idx).showna is True)

Options for the return value are:

  • If the button uses the default color, this returns None.

  • If the button color was set by editing the ButtonSettings on the property grid, this returns the color's rgb (hex) value.

  • If the button color was set by inspect.cursubi.rating(idx).setcolor, this will return that value as it was set - either the color's rgb (hex) value or its colorname.

9.1

inspect.cursubi.rating(idx).getdefect(value)

where idx is the TestID property of the test.

myvar = inspect.cursubi.rating(0).getdefect(5)

Sets the myvar variable to the name of the defect that is set for the button with value 5.

For one Rating button, this returns the name of the DMS defect that will be stored if that button is selected.

value determines which button you are working with. Valid options are:

  • numeric value of the button: an integer from inspect.cursubi.rating(idx).min to inspect.cursubi.rating(idx).max

  • 10 = N/A button selected (only valid if inspect.cursubi.rating(idx).showna is True)

If the return value is None, then the button is not configured with a defect.

9.1

inspect.cursubi.rating(idx).getforcenote()

where idx is the TestID property of the test.

inspect.cursubi.rating(idx).getforcenote()

Gets the ForceNote property for this test.

Gets the ForceNote property for this test.

This property determines whether to require entry of notes and/or corrective actions when a defect is present on this test.

Return value is a list in the format [ecat, note].

ecat will be one of these:

note will be either True (require Note entry) or False (do not require Note entry). If ecat is -1 (use the sub-inspection ForceNote property), this reflects the setting from the sub-inspection.

9.1

inspect.cursubi.rating(idx).getlabel(value)

where idx is the TestID property of the test.

myvar = inspect.cursubi.rating(0).getlabel(5)

Sets the myvar variable to the label on the button with value 5.

For one Rating button, this returns that button's label.

value determines which button you are working with. Valid options are:

  • numeric value of the button: an integer from inspect.cursubi.rating(idx).min to inspect.cursubi.rating(idx).max

  • 10 = N/A button selected (only valid if inspect.cursubi.rating(idx).showna is True)

9.1

inspect.cursubi.rating(idx).gettrace

where idx is the TestID property of the test.

inspect.cursubi.rating(0).gettrace(3)

Gets the value of traceability field 3 that was set for this test only by executing the inspect.cursubi.rating(0).settrace(3, value) command or by setting the TestSpecificTrace property for this test.

Gets the value of a traceability field that was set for this test only by executing the corresponding inspect.cursubi.rating(idx).settrace command or by setting the TestSpecificTrace property for this test.

9.1

inspect.cursubi.rating(idx).label

where idx is the TestID property of the test.

inspect.cursubi.rating(0).label = "Crispiness Rating"

Sets the label displayed above the Rating test to "Crispiness Rating".

Gets or sets the text label displayed at the top of the test.

For a blank label, use None.

9.1

inspect.cursubi.rating(idx).max

where idx is the TestID property of the test.

inspect.cursubi.rating(0).max = 7

Sets the maximum Rating value to 7.

myvar = inspect.cursubi.rating(0).max

Sets the myvar variable to the test's maximum Rating value.

Gets or sets the Maximum property (maximum Rating value) for this test.

  • Must be an integer from 1 to 9.

  • Must be greater than inspect.cursubi.rating(idx).min

When setting this property, the display will update after the Python script completes.

9.1

inspect.cursubi.rating(idx).min

where idx is the TestID property of the test.

inspect.cursubi.rating(0).min = 1

Sets the minimum Rating value to 1.

myvar = inspect.cursubi.rating(0).min

Sets the myvar variable to the test's minimum Rating value.

Gets or sets the Minimum property (minimum Rating value) for this test.

  • Must be an integer from 0 to 8.

  • Must be less than inspect.cursubi.rating(idx).max

When setting this property, the display will update after the Python script completes.

9.1

inspect.cursubi.rating(idx).note

where idx is the TestID property of the test.

inspect.cursubi.rating(0).note = "My note"

Sets the note for the test.

Gets or sets the note for the Rating test.

9.1

inspect.cursubi.rating(idx).partno

where idx is the TestID property of the test.

inspect.cursubi.rating(0).partno = "Temp 1250"

If the SPC standard "Temp 1250" exists, this sets the SPC standard for this test to "Temp 1250".

myvar = inspect.cursubi.rating(0).partno

Sets the myvar variable to the name of the test's SPC standard.

Gets or sets the StandardSPC property for this Rating test.

When setting the SPC standard, that standard must already exist in GainSeeker.

9.1

inspect.cursubi.rating(idx).samplesize

where idx is the TestID property of the test.

inspect.cursubi.rating(0).samplesize = 5

Sets the sample size of the Rating test to 5.

Gets or sets the SampleSize property for this Rating test.

Sample size must be a number greater than or equal to 0. (The default sample size for a new Rating test is 1.)

9.1

inspect.cursubi.rating(idx).secondrowbeginswith

where idx is the TestID property of the test.

inspect.cursubi.rating(0).secondrowbeginswith = 4

Configures this test to display a second row of buttons, starting with the button with value "4".

myvar = inspect.cursubi.rating(0).secondrowbeginswith

Sets the myvar variable to the value of the SecondRowBeginsWith property for this test.

Gets or sets the SecondRowBeginsWith property for this test.

Must be one of the following integers:

  • numeric value of the button: an integer from (inspect.cursubi.rating(idx).min + 1) to inspect.cursubi.rating(idx).max

  • -1 = All On First Row

  • 10 = N/A button selected (only valid if inspect.cursubi.rating(idx).showna is True)

When setting this property, the display will update after the Python script completes.

9.1

inspect.cursubi.rating(idx).setcolor(value, newColor)

where idx is the TestID property of the test.

inspect.cursubi.rating(0).setcolor(5, "red")

When the button with value 5 is selected, it will be colored red.

For one Rating button, this sets the color that will be displayed when that button is selected.

value determines which button you are working with. Valid options are:

  • numeric value of the button: an integer from inspect.cursubi.rating(idx).min to inspect.cursubi.rating(idx).max

  • 10 = N/A button selected (only valid if inspect.cursubi.rating(idx).showna is True)

newColor is the string for the new color. You may specify the color's rgb (hex) value or its colorname. (For a full list of colornames - such as "red", "orange", "yellow", "green", "blue", "white", and many more - see https://www.colorcodehex.com/html-color-names.html or http://cng.seas.rochester.edu/CNG/docs/x11color.html.) The text color is always black, so best practice is to avoid a dark color for the button.

To clear the button color, specify a newColor of None.

9.1

inspect.cursubi.rating(idx).setdefect(value, newDefect)

where idx is the TestID property of the test.

inspect.cursubi.rating(0).setdefect(5, "Burn")

When the button with value 5 is selected, any DMS record saved for this test will have the defect "Burn".

For one Rating button, this sets the DMS defect that will be stored if that button is selected.

value determines which button you are working with. Valid options are:

  • numeric value of the button: an integer from inspect.cursubi.rating(idx).min to inspect.cursubi.rating(idx).max

  • 10 = N/A button selected (only valid if inspect.cursubi.rating(idx).showna is True)

newDefect is the defect name. This defect must already exist in GainSeeker.

To clear any defects from the button, specify a newDefect of None.

9.1

inspect.cursubi.rating(idx).setforcenote(ecat, note)

where idx is the TestID property of the test.

inspect.cursubi.rating(0).setforcenote(-1)

Sets this test to use the sub-inspection ForceNote property.

inspect.cursubi.rating(0).setforcenote(1, True)

Inspector will be required to enter an Event and a Note when a defect is present for this test.

Sets the ForceNote property for this test.

This property determines whether to require entry of notes and/or corrective actions when a defect is present on this test.

ecat must be one of these:

For the note parameter:

  • If ecat is -1 (use the sub-inspection ForceNote property), the note is ignored and can be omitted.

  • If ecat is anything else:

    • To require Note entry, specify True for this parameter.

    • To specify that Note entry is not required, you can omit this parameter or specify False .

9.1

inspect.cursubi.rating(idx).setlabel(value, newlabel)

where idx is the TestID property of the test.

inspect.cursubi.rating(0).setlabel(5, "5: Burned")

Configures the label for button value 5 to display "5: Burned".

For one Rating button, this sets the label that will be displayed.

value determines which button you are working with. Valid options are:

  • numeric value of the button: an integer from inspect.cursubi.rating(idx).min to inspect.cursubi.rating(idx).max

  • 10 = N/A button selected (only valid if inspect.cursubi.rating(idx).showna is True)

newlabel is the string for the new label. To use the default label for that button's value (such as '1: ' for button value 1), use a blank string ('').

9.1

inspect.cursubi.rating(idx).setncu

where idx is the TestID property of the test.

inspect.cursubi.rating(0).setncu = True

Configures this Rating test so that selecting a Rating with a defect sets NCU=1 in the DMS data record.

myvar = inspect.cursubi.rating(0).setncu

Sets the myvar variable to the value of the SetNCU property for the Rating test.

Gets or sets the value of the SetNCU property for the Rating test.

This property determines whether selecting a Rating with a defect will set the NCU (nonconforming units) field in the DMS data record for the Rating test.

Valid options are True (selecting a Rating with a defect sets NCU=1) or False (selecting a Rating with a defect does not affect NCU).

9.1

inspect.cursubi.rating(idx).settrace

where idx is the TestID property of the test.

inspect.cursubi.rating(0).settrace(3, "E1403")

Sets traceability field 3 to "E1403" for this test only.

Sets the value of a traceability field for this test only.

Takes precedence over all other methods that might set this traceability value (e.g., value pre-filled by inspection or planned inspection, value entered by user, value set by other Python commands, test-specific properties that might set this traceability value, etc.).

Value is automatically cleared from the current traceability buffer after the sub-inspection is submitted or cancelled.

9.1

inspect.cursubi.rating(idx).showna

where idx is the TestID property of the test.

inspect.cursubi.rating(0).showna = True

Configures this Rating test so that an "N/A" button is added to the end of the Rating scale.

myvar = inspect.cursubi.rating(0).showna

Sets the myvar variable to the value of the ShowNA property for the Rating test.

Gets or sets the value of the ShowNA property for the Rating test.

Valid options are True (display an "N/A" button at the end of the Rating scale) or False (do not add an "NA" button).

9.1

inspect.cursubi.rating(idx).trace

where idx is the TestID property of the test.

inspect.cursubi.rating(0).trace = 6

Configures this Rating test to store the label of the selected Rating button in traceability field 6.

myvar = inspect.cursubi.rating(0).trace

Sets the myvar variable to the traceability field number where the label of the selected Rating button will be stored.

Gets or sets the TraceField property for this test - the traceability field number where the label of the selected Rating button will be stored.

Must be either a valid traceability field number (1 - 48) or 0 to clear the traceability field.

9.1

inspect.cursubi.rating(idx).valuelabel

where idx is the TestID property of the test.

myvar = inspect.cursubi.rating(0).valuelabel

Sets the myvar variable to the label of the currently selected Rating button.

Returns the label for the currently selected Rating button.

If no rating has been selected, this returns None.

9.1

inspect.cursubi.rating(idx).valuenumber

where idx is the TestID property of the test.

inspect.cursubi.rating(0).valuenumber = 3

Selects the Rating button with the value of 3.

myvar = inspect.cursubi.rating(0).valuenumber

Sets the myvar variable to the numeric value of the currently selected Rating button.

Sets a Rating or returns the selected Rating for this test. Setting the Rating is equivalent to the inspector selecting a Rating button.

Must be one of the following integers:

  • numeric value of the button: an integer from inspect.cursubi.rating(idx).min to inspect.cursubi.rating(idx).max

  • -1 = no Rating button selected

  • 10 = N/A button selected (only valid if inspect.cursubi.rating(idx).showna is True)

When setting this property, the display will update after the Python script completes.

9.1

inspect.cursubi.rating(idx).verticalsize

where idx is the TestID property of the test.

inspect.cursubi.rating(0).verticalsize = 1

This sets the display height of the Rating test to Short.

Gets or sets the display height of the test.

Valid options are 0 (Regular) and 1 (Short).

9.1

inspect.cursubi.rating(idx).visible

where idx is the TestID property of the test.

inspect.cursubi.rating(0).visible = False

This sets the Rating test to 'not visible'.

Gets or sets whether the Rating test will be visible.

Valid options are True (visible) and False (not visible).

If not visible:

  • The inspector cannot interact with this test.

  • No data will be stored for this test when the sub-inspection is submitted.

  • If this test is required, the sub-inspection can be submitted even if no value has been set for this test.

9.1

Text test

Syntax

Example

Description/Remarks

New or
changed
in version

inspect.cursubi.text(idx).text

where idx is the TestID property of the test.

inspect.cursubi.text(0).text = "Please follow instructions."

Gets or sets the text for the Text test.

 

inspect.cursubi.text(idx).textalign

where idx is the TestID property of the test.

inspect.cursubi.text(0).textalign = 1

Gets or sets the TextAlign property of this test.

0 : Center align

1 : Left align

2 : Right align

9.2

inspect.cursubi.text(idx).verticalsize

where idx is the TestID property of the test.

inspect.cursubi.text(0).verticalsize = 1

This sets the display height of the Text test to Short.

Gets or sets the display height of the test.

Valid options are 0 (Regular) and 1 (Short).

9.1

inspect.cursubi.text(idx).visible

where idx is the TestID property of the test.

inspect.cursubi.text(0).visible = False

This sets the Text test to 'not visible'.

Gets or sets whether the Text test will be visible.

Valid options are True (visible) and False (not visible).

9.1

Timer test

Syntax

Example

Description/Remarks

New or
changed
in version

inspect.cursubi.timer(idx).actiontaken

where idx is the TestID property of the test.

inspect.cursubi.timer(0).actiontaken = "Replaced Fill Hose"

Gets/Sets the Action Taken field for this test only.

When setting this field, you must specify the Long Description for the Action Taken, not the Short Description. The value must already exist in the Action Taken list or it is ignored.

For this test, this Action Taken overrides an Action Taken test on the sub-inspection.

9.1

inspect.cursubi.timer(idx).anchorpoint

where idx is the TestID property of the test.

inspect.cursubi.timer(0).anchorpoint = True

Gets/Sets the Anchor Point field for this test only.

Valid options are True (test is marked as an Anchor Point) or False (test is not an Anchor Point).

If inspect.cursubi.anchorpoint is True, that sets the Anchor Point for the sub-inspection and overrides this test-specific setting.

9.1

inspect.cursubi.timer(idx).cause

where idx is the TestID property of the test.

inspect.cursubi.timer(0).cause = "Fill Hose Plugged"

Gets/Sets the Cause field for this test only.

When setting this field, you must specify the Long Description for the Cause, not the Short Description. The value must already exist in the Cause list or it is ignored.

For this test, this Cause overrides a Cause test on the sub-inspection.

9.1

inspect.cursubi.timer(idx).eventspc

where idx is the TestID property of the test.

inspect.cursubi.timer(0).eventspc = "Changeover"

Gets/Sets the SPC Event field for this test only.

When setting this field, you must specify the Long Description for the SPC Event, not the Short Description. The value must already exist in the SPC Event list or it is ignored.

For this test, this SPC Event overrides an SPC Event test on the sub-inspection.

9.1

inspect.cursubi.timer(idx).focus()

where idx is the TestID property of the test.

inspect.cursubi.timer(0).focus()

Sets the focus to the Timer test with TestID 0.

Sets the focus to this test (as if the user had pressed the Tab key to move the focus to this test) after the Python script completes.

When one script executes this .focus() method for multiple tests, the focus will be set to the last test for which .focus() was executed.

Common practice is to execute this command in a Formula test with the FormulaMode property set to Pre, which sets the focus to a particular test when the sub-inspection opens.

9.2

inspect.cursubi.timer(idx).gettrace(index)

where idx is the TestID property of the test

and index is the traceability field number.

inspect.cursubi.timer(0).gettrace(3)

Gets the value of traceability field 3 that was set for this test only by executing the inspect.cursubi.timer(0).settrace(3, value) command or by setting the TestSpecificTrace property for this test.

Gets the value of a traceability field that was set for this test only by executing the corresponding inspect.cursubi.timer(idx).settrace command or by setting the TestSpecificTrace property for this test.

8.9

inspect.cursubi.timer(idx).label

where idx is the TestID property of the test.

inspect.cursubi.timer(0).label = "Start the test"

Gets or sets the Label property of this test.

Use None for a blank Label property.

9.2

inspect.cursubi.timer(idx).partno

where idx is the TestID property of the test.

inspect.cursubi.timer(0).partno = "A-50RB seconds per cycle"

Gets or sets the SPCStandard property of this test.

If inspect.cursubi.timer(idx).resultstorage = 1 (SPCStandard), this property must be set to an existing SPC standard.

9.2

inspect.cursubi.timer(idx).resultstorage

where idx is the TestID property of the test.

inspect.cursubi.timer(0).resultstorage = 0

Gets or sets the ResultStorage property of this test.

0 : DoNoStore

1 : SPCStandard

2 : Traceability

If this property is set to SPCStandard and the inspect.cursubi.timer(idx).partno property is not set to an existing SPC standard, an error will occur when the sub-inspection is submitted.

If this property is set to Traceability and the inspect.cursubi.timer(idx).trace property is not set to a valid traceability field, an error will occur when the sub-inspection is submitted.

9.2

inspect.cursubi.timer(idx).settrace(index, value)

where idx is the TestID property of the test

and index is the traceability field number.

inspect.cursubi.passfail(0).settrace(3, "E1403")

Sets traceability field 3 to "E1403" for this test only.

Sets the value of a traceability field for this test only.

Takes precedence over all other methods that might set this traceability value (e.g., value pre-filled by inspection or planned inspection, value entered by user, value set by other Python commands, test-specific properties that might set this traceability value, etc.).

Value is automatically cleared from the current traceability buffer after the sub-inspection is submitted or cancelled.

8.9

inspect.cursubi.timer(idx).starttimer()

where idx is the TestID property of the test.

inspect.cursubi.timer(0).starttimer()

This command starts or restarts the timer.

The timer will be started when the current script ends or when inspect.update() is executed.

9.2

inspect.cursubi.timer(idx).timerseconds

where idx is the TestID property of the test.

inspect.cursubi.timer(0).timerseconds = 30

Gets or sets the TimerSeconds property of this test.

If this timer is already running, changing this property will stop and reset the timer. (You can use inspect.cursubi.timer(idx).starttimer() to restart the timer.)

9.2

inspect.cursubi.timer(idx).trace

where idx is the TestID property of the test.

inspect.cursubi.timer(0).trace = 8

Gets or sets the Traceability property of this test.

A number from 1 to the maximum traceability field number. Set to 0 to clear this property.

If inspect.cursubi.timer(idx).resultstorage = 2 (Traceability), this property must be set to an existing traceability field number.

9.2

inspect.cursubi.timer(idx).value

where idx is the TestID property of the test.

inspect.cursubi.timer(0).value

Gets the current value of the Timer test.

8.8

inspect.cursubi.timer(idx).verticalsize

where idx is the TestID property of the test.

inspect.cursubi.timer(0).verticalsize = 1

This sets the display height of the Timer test to Short.

Gets or sets the display height of the test.

Valid options are 0 (Regular) and 1 (Short).

9.1

inspect.cursubi.timer(idx).visible

where idx is the TestID property of the test.

inspect.cursubi.timer(0).visible = False

This sets the Timer test to 'not visible'.

Gets or sets whether the Timer test will be visible.

Valid options are True (visible) and False (not visible).

If not visible:

  • The inspector cannot interact with this test.

  • No data will be stored for this test when the sub-inspection is submitted.

  • If this test is required, the sub-inspection can be submitted even if no value has been set for this test.

9.1

Traceability test

Syntax

Example

Description/Remarks

New or
changed
in version

inspect.cursubi.trace(idx).barcodeallowed

where idx is the TestID property of the test.

inspect.cursubi.trace(0).barcodeallowed = True

Gets or sets the BarcodeAllowed property for this Traceability test.

If this is set to True, the test will act as if the EntryRestricted property is set to False, no matter what that property is actually set to.

When the test is set to the DMS Event, SPC Event, SPC Cause or SPC Action Taken, changes to this setting are ignored.

9.2

inspect.cursubi.trace(idx).enabled

where idx is the TestID property of the test.

inspect.cursubi.trace(0).enabled = False

Gets or sets whether this Traceability test will be enabled or disabled from user interaction ("grayed out").

Valid options are True (enabled, the default) and False (disabled).

Whether enabled or disabled: the test is visible to the inspector, the value of the test can be set through Python code, and the value of the test is stored when the sub-inspection is submitted. If the test is required but does not have a value, the sub-inspection cannot be submitted.

Disabling a test lets you set its value and store the test without allowing the inspector to change its value. If you don't want to store the test, use inspect.cursubi.trace(idx).visible.

 

inspect.cursubi.trace(idx).focus()

where idx is the TestID property of the test.

inspect.cursubi.trace(0).focus()

Sets the focus to the Traceability test with TestID 0.

Sets the focus to this test (as if the user had pressed the Tab key to move the focus to this test) after the Python script completes.

When one script executes this .focus() method for multiple tests, the focus will be set to the last test for which .focus() was executed.

Common practice is to execute this command in a Formula test with the FormulaMode property set to Pre, which sets the focus to a particular test when the sub-inspection opens.

9.2

inspect.cursubi.trace(idx).getindex()

where idx is the TestID property of the test.

myresult = inspect.cursubi.trace(0).getindex

Returns a number to indicate which traceability field (or other field) is assigned to this Traceability test.

Possible results include:

  • 1 or higher : traceability field index

  • 0 : Text Entry

  • -1 : SPC Event

  • -2 : SPC Cause

  • -3 : SPC Action Taken

  • -4 : DMS Event

9.3

inspect.cursubi.trace(idx).label

where idx is the TestID property of the test.

inspect.cursubi.trace(0).label = "Enter your 4-digit employee number:"

Gets or sets the label displayed to the inspector for this test.

Applies to all information types for this test, including DMS Event, SPC Event, SPC Cause or SPC Action Taken.

9.2

inspect.cursubi.trace(idx).list

where idx is the TestID property of the test.

inspect.cursubi.trace(0).list = ["Machine 1", "Machine 2", "Machine3"]

Sets three values that can be selected by the operator.

inspect.cursubi.trace("SKUs").list = traceability.getprioritylist(6)

Changes the drop-down list for a traceability test with the Test ID "SKUs" to the priority list set up for traceability field 6 for the current GainSeeker user.

Gets or sets the list of items the inspector can select for the Traceability test.

When the test is set to the DMS Event, SPC Event, SPC Cause or SPC Action Taken, this is the list of Long Descriptions for that item.

9.2

inspect.cursubi.trace(idx).required

where idx is the TestID property of the test.

inspect.cursubi.trace(0).required = True

Sets the EntryRequired test property to true.

Gets or sets the value of the EntryRequired Traceability test property.

 

inspect.cursubi.trace(idx).restricted

where idx is the TestID property of the test.

inspect.cursubi.trace(0).restricted = True

Sets the EntryRestricted test property to true.

Gets or sets the value of the EntryRestricted Traceability test property.

This command will be ignored if the BarcodeAllowed property is set to True.

If the current value of the Traceability test is not in the pre-defined list and this property is changed from False to True, that traceability value will be cleared.

9.2

inspect.cursubi.trace(idx).value

where idx is the TestID property of the test.

inspect.cursubi.trace(0).value = "Machine 1"

This sets the value of the traceability to "Machine 1"

Gets or sets the value of the Traceability test.

When the test is set to the DMS Event, SPC Event, SPC Cause or SPC Action Taken, this is the Long Description for that item.

9.2

inspect.cursubi.trace(idx).verticalsize

where idx is the TestID property of the test.

inspect.cursubi.trace(0).verticalsize = 1

This sets the display height of the Traceability test to Short.

Gets or sets the display height of the test.

Valid options are 0 (Regular) and 1 (Short).

When the test is set to the DMS Event, SPC Event, SPC Cause or SPC Action Taken, changes to this setting are ignored.

9.1

inspect.cursubi.trace(idx).visible

where idx is the TestID property of the test.

inspect.cursubi.trace(0).visible = False

This sets the Traceability test to 'not visible'.

Gets or sets whether the Traceability test will be visible.

Valid options are True (visible) and False (not visible).

If not visible:

  • The inspector cannot interact with this test.

  • No data will be stored for this test when the sub-inspection is submitted.

  • If this test is required, the sub-inspection can be submitted even if no value has been set for this test.

9.1

Inspection or Sub-inspection commands

These commands affect the current inspection or sub-inspection.

Side Panel items

These are the current commands for side panel items. See below for deprecated commands.

Syntax

Example

Description/Remarks

New or
changed
in version

inspect.sidepanel.addfile(label, path)

inspect.sidepanel.addfile("Comments", "C:\\Users\\myfile.txt")

Adds the specified file to a side panel tab labeled "Comments".

Adds a file or image to the side panel.

label specifies how this item's side panel tab will be labeled.

path specifies the file or image to add.

Changes to the side panel are displayed after the Python script completes.

8.9

inspect.sidepanel.addwebpage(label, url)

inspect.sidepanel.addwebpage("Search", "www.google.com")

Adds the specified URL to a side panel tab labeled "Search".

Adds a webpage to the side panel.

label specifies how this item's side panel tab will be labeled.

url specifies the webpage or string of HTML content to add.

If specifying an HTML string, it must register as well-formed xml in order to be displayed, using the following rules:

    • All tags are case-sensitive and must be properly nested.
      This is properly nested:  <b><i>...</i></b>
      This is improperly nested:  <b><i>...</b></i>

    • The string must start and end with a pair or opening and closing tags, such as  <html>...</html>  or  <body>...</body> .

    • All elements must have a closing tag, such as  <p>...</p>  or  <br /> .

Changes to the side panel are displayed after the Python script completes.

8.9

inspect.sidepanel.clear()

inspect.sidepanel.clear()

Clears all items from the side panel.

Clears all items from the side panel.

Changes to the side panel are displayed after the Python script completes.

Note: If the script also changes one of the following, the charts will be redrawn after all the items have been cleared:

  • Traceability value

  • DMS Process

  • DMS Standard

  • SPC Standard (for a Numeric Input test)

8.9

inspect.sidepanel.count

panelcount = inspect.sidepanel.count

Sets the value of a panelcount variable to the current number of side panel tabs.

Gets the number of current side panel tabs.

8.9

inspect.sidepanel.dmschartgroupnames

mylist = inspect.sidepanel.dmschartgroupnames

Gets a list of all the DMS chart group names for the current sub-inspection.

Returns a list of all the DMS chart group names for the current sub-inspection.

9.3

inspect.sidepanel.dmscharts(chartGroupName = "", charttype = 0, partno = "", process = "").exportimages()

myfiles = inspect.sidepanel.dmscharts().exportimages()

Export all current DMS side panel charts to files in the user's temp folder, and returns a list of the filenames that were exported.

Export DMS side panel charts to files in the user's temp folder, and returns a list of the filenames that were exported.

You can use the optional parameters chartGroupName, charttype, partno, and/or process to limit the charts that will be exported.

chartGroupName is the name of a chart group from any sub-inspection.

charttype is an integer and can be any of the following:

0

AllCharts

 

22

DmsOEETime

1

DmsControlChart

 

23

DmsMultParetoDfctPctTotalDfct

2

DmsControlDetail

 

24

DmsMultParetoDfctPctTotalSS

3

DmsStatisticsList

 

25

DmsMultParetoCostPctDfctCost

4

DmsDataTable

 

26

DmsMultParetoCostPctTotalCost

5

DmsParetoDfctPctTotalDfct

 

27

DmsMultParetoDfctPerUnit

6

DmsParetoDfctPctTotalSS

 

28

DmsMultParetoSigma

7

DmsParetoCostPctDfctCost

 

29

DmsMultDPUChart

8

DmsParetoCostPctTotalCost

 

30

DmsMultYieldChart

9

DmsParetoDfctPerUnit

 

31

DmsMultCostChart

10

DmsParetoSigma

 

32

DmsMultParetoDetail

11

DmsDPUChart

 

33

DmsMultDPUDetail

12

DmsYieldChart

 

34

DmsMultDataTable

13

DmsCostChart

 

35

DmsMultStatisticsList

14

DmsParetoDetail

 

36

DmsMultOEE

15

DmsDPUDetail

 

37

DmsMultOEEAvail

16

DmsOEE

 

38

DmsMultOEEPerf

17

DmsOEEAvail

 

39

DmsMultOEEQual

18

DmsOEEPerf

 

40

DmsMultOEECombined

19

DmsOEEQual

 

41

DmsMultOEEDetail

20

DmsOEECombined

 

42

DmsMultOEETime

21

DmsOEEDetail

 

43

DmsMultStatisticsTable

To filter for any charts that are drawn for a specific DMS part number or process, use the partno and/or process parameters to specify the those values.

9.3

inspect.sidepanel.dmscharts(chartGroupName = "", charttype = 0, partno = "", process = "").refresh()

inspect.sidepanel.dmscharts().refresh()

Refreshes all current DMS side panel charts.

Refreshes DMS side panel charts.

You can use the optional parameters chartGroupName, charttype, partno, and/or process to limit the charts that will be refreshed.

chartGroupName is the name of a chart group from any sub-inspection.

charttype is an integer. For a list of valid chart types, see inspect.sidepanel.dmscharts().exportimages() .

To filter for any charts that are drawn for a specific DMS part number or process, use the partno and/or process parameters to specify the those values.

9.3

inspect.sidepanel.frontonrefresh

inspect.sidepanel.frontonrefresh = False

Prevents side panel charts from automatically moving to the left-most position when the sub-inspection is submitted.

Determines what happens to existing side panel tabs when submitting a sub-inspection will refresh a chart.

  • When set to True (the default):

    Submitting the sub-inspection will automatically move the tab for that chart to the left-most position and display the updated chart to the inspector.

  • When set to False:

    Submitting the sub-inspection will not move any tabs on the side panel. However, it will still display the left-most tab to the inspector.

This will persist across sub-inspections and inspections until the list of sub-inspections or inspections is displayed.

Please note that when any information changes that will refresh the chart, that chart will be moved to the left-most position and displayed to the inspector - even if this is set to False.

8.9

9.3

inspect.sidepanel.itemtofront(item)

inspect.sidepanel.itemtofront("Flowchart")

Moves the tab labeled "Flowchart" to the left-most position on the side panel, and displays this item (after the Python script completes).

inspect.sidepanel.itemtofront(1)

Moves the tab that is currently in the second-from-the-right position on the side panel to the left-most position, and displays this item (after the Python script completes).

inspect.sidepanel.itemtofront("Control Plan")

inspect.sidepanel.itemtofront("Flowchart")

inspect.sidepanel.itemtofront("Overview")

This script moves 3 items in sequence to the left-most position on the side panel.

The result is a side panel where the first three tabs (from left to right) are "Overview", "Flowchart", and "Control Plan".

The "Overview" tab is displayed because it was the most recent item to be moved.

Moves the specified side panel tab to the front (left-most) position and displays that item to the inspector. Changes to the side panel are displayed after the Python script completes.

item must be one of these:

  • A string containing the text label for the desired side panel tab - for example, the label for an image, thumbnail text for a document, or chart name for GainSeeker data. (If two or more tabs use the same label, you may get unexpected results.)

  • A number that corresponds to the order in which items are displayed on the side panel, counting from right (index 0) to left.

    For example: on a side panel with four tabs, the right-most tab is number 0, the next is number 1, the next is number 2, and the left-most tab is number 3.

Using this command to re-order the tabs on the side panel will also re-order the labels returned by the inspect.sidepanel.labels command (below).

To control what happens to existing side panel tabs when submitting a sub-inspection will refresh a chart, see inspect.sidepanel.frontonrefresh.

8.9

inspect.sidepanel.labels

tablist = inspect.sidepanel.labels

Sets the value of a tablist variable to the current list of side panel tab labels.

Gets the list of current side panel tab labels, in order.

8.9

inspect.sidepanel.selectitem(item)

inspect.sidepanel.selectitem("Flowchart")

Displays the side panel tab labeled "Flowchart".

inspect.sidepanel.selectitem(1)

Displays whatever side panel tab is second from the right.

Displays the specified side panel tab (after the Python script completes).

item must be one of these:

  • A string containing the text label for the desired side panel tab - for example, the label for an image, thumbnail text for a document, or chart name for GainSeeker data. (If two or more tabs use the same label, you may get unexpected results.)

  • A number that corresponds to the order in which items are displayed on the side panel, counting from right (index 0) to left.

    For example: on a side panel with four tabs, the right-most tab is number 0, the next is number 1, the next is number 2, and the left-most tab is number 3.

To control what happens to existing side panel tabs when submitting a sub-inspection will refresh a chart, see inspect.sidepanel.frontonrefresh.

8.9

inspect.sidepanel.spcchartgroupnames

mylist = inspect.sidepanel.spcchartgroupnames

Gets a list of all the SPC chart group names for the current sub-inspection.

Returns a list of all the SPC chart group names for the current sub-inspection.

9.3

inspect.sidepanel.spccharts(chartGroupName = "", charttype = 0, testid = None, partno = "").exportimages()

myfiles = inspect.sidepanel.spccharts().exportimages()

Export all current SPC side panel charts to files in the user's temp folder, and returns a list of the filenames that were exported.

Export SPC side panel charts to files in the user's temp folder, and returns a list of the filenames that were exported.

You can use the optional parameters chartGroupName, charttype, testid, and/or partno to limit the charts that will be exported.

chartGroupName is the name of a chart group from any sub-inspection.

charttype is an integer and can be any of the following:

0

AllCharts

 

11

SpcMovingAverageChart

1

SpcControlChart

 

12

SpcTimeAxisChart

2

SpcHistogram

 

13

SpcProbabilityPlot

3

SpcStatisticsList

 

14

SpcPerformance

4

SpcDataTable

 

15

SpcMultCharts

5

SpcCombinationChart

 

16

SpcMultBoxWhisker

6

SpcCusumChart

 

17

SpcMultStatisticsTable

7

SpcXBarMRRange

 

18

SpcMultDataTable

8

SpcScatterChart

 

19

SpcMultCombinedControlChart

9

SpcTrendChart

 

20

SpcMonitorTable

10

SpcEwmaChart

 

 

 

To filter for any charts that are linked to a particular Numeric Input test, use the testid parameter to specify the number or name of that test's TestID property.

To filter for any charts that are drawn for a specific SPC standard, use the partno parameter to specify the name of that SPC standard.

9.3

inspect.sidepanel.spccharts(chartGroupName = "", charttype = 0, testid = None, partno = "").refresh()

inspect.sidepanel.spccharts().refresh()

Refreshes all current SPC side panel charts.

Refreshes SPC side panel charts.

You can use the optional parameters chartGroupName, charttype, testid, and/or partno to limit the charts that will be refreshed.

chartGroupName is the name of a chart group from any sub-inspection.

charttype is an integer. For a list of valid chart types, see inspect.sidepanel.spccharts().exportimages() .

To filter for any charts that are linked to a particular Numeric Input test, use the testid parameter to specify the number or name of that test's TestID property.

To filter for any charts that are drawn for a specific SPC standard, use the partno parameter to specify the name of that SPC standard.

9.3

 

These are deprecated commands for side panel items. See above for the current commands.

Syntax

Example

Description/Remarks

New or
changed
in version

inspect.cursubi.addfile(label, path)

inspect.cursubi.addfile("item label", "C:\\Users\\myfile.txt")

Deprecated - use inspect.sidepanel.addfile instead.

Adds a file or image to the side panel after the Python script completes.

 

inspect.cursubi.addwebpage(label, url)

inspect.cursubi.addwebpage("item label", "www.google.com")

Deprecated - use inspect.sidepanel.addwebpage instead.

Adds a webpage to the side panel after the Python script completes.

 

inspect.cursubi.clearsidepanel

inspect.cursubi.clearsidepanel = True

This clears the side panel in PC Collect.

Deprecated - use inspect.sidepanel.clear() instead.

When set to True, clears any side panel items that existed before the Python script was launched. (Side panel items are actually cleared when the Python script finishes.)

 

inspect.cursubi.selectsidepanelitem(item)

inspect.cursubi.selectsidepanelitem("Flowchart")

Displays the side panel tab labeled "Flowchart".

inspect.cursubi.selectsidepanelitem(1)

Displays whatever side panel tab is second from the right.

Deprecated - use inspect.sidepanel.selectitem instead.

Displays the specified side panel tab.

item must be one of these:

  • A string containing the text label for the desired side panel tab - for example, the label for an image, thumbnail text for a document, or chart name for GainSeeker data.

  • A number that corresponds to the order in which items are displayed on the side panel, counting from right (index 0) to left.

    For example: on a side panel with four tabs, the right-most tab is number 0, the next is number 1, the next is number 2, and the left-most tab is number 3.

 

Message area

Syntax

Example

Description/Remarks

New or
changed
in version

inspect.messagearea.color

inspect.messagearea.color = "Red"

Sets the sub-inspection message area's background color to Red.

inspect.messagearea.color = "#00FF00"

Sets the sub-inspection message area's background color to Lime.

Gets or sets the background color for the sub-inspection message area.

The sub-inspection message area is the blank space next to the Cancel button at the bottom of the sub-inspection. (This area is larger if the PictureMode and VideoMode properties for the sub-inspection are both Off.)

You may specify the color's rgb (hex) value or its colorname. (For a full list of colornames - such as "red", "orange", "yellow", "green", "blue", "white", and many more - see https://www.colorcodehex.com/html-color-names.html or http://cng.seas.rochester.edu/CNG/docs/x11color.html.) The best practice is to set this to a color different from the forecolor (below) so the text is readable.

This will persist across sub-inspections and inspections until the list of sub-inspections or inspections is displayed.

To clear the background color, set this to None or a blank string.

8.8

inspect.messagearea.forecolor

inspect.messagearea.color = "Black"

inspect.messagearea.forecolor = "White"

Sets the sub-inspection message area's background color to Black and its foreground (font) color to White.

 

inspect.messagearea.forecolor = "#00FF00"

Sets the sub-inspection message area's foreground (font) color to Lime.

Gets or sets the foreground (font) color for the sub-inspection message area.

The sub-inspection message area is the blank space next to the Cancel button at the bottom of the sub-inspection. (This area is larger if the PictureMode and VideoMode properties for the sub-inspection are both Off.)

You may specify the color's rgb (hex) value or its colorname. (For a full list of colornames - such as "red", "orange", "yellow", "green", "blue", "white", and many more - see https://www.colorcodehex.com/html-color-names.html or http://cng.seas.rochester.edu/CNG/docs/x11color.html.) The best practice is to set this to a color different from the background color (above) so the text is readable.

This will persist across sub-inspections and inspections until the list of sub-inspections or inspections is displayed.

To clear the foreground color, set this to None or a blank string.

9.2

inspect.messagearea.script

inspect.messagearea.script = "my script 3"

Converts the sub-inspection message area into a clickable button that runs the existing script named "my script 3".

Gets or sets the Python script that is run when the message area is clicked.

The sub-inspection message area is the blank space next to the Cancel button at the bottom of the sub-inspection. (This area is larger if the PictureMode and VideoMode properties for the sub-inspection are both Off.)

To convert the message area into a clickable button, set this to the name of a GainSeeker Python script. The script being called must exist in the GainSeeker Inspections module.

This will persist across sub-inspections and inspections until the list of sub-inspections or inspections is displayed.

When the inspector clicks this message area button, the testid variable is set to "[MESSAGEAREA]".

To turn off the clickable button, set this to None or a blank string.

9.1

inspect.messagearea.text

inspect.messagearea.text = "Sample passed all tests"

Displays the specified text string in the sub-inspection message area.

Gets or sets the text string for display in the sub-inspection message area.

The sub-inspection message area is the blank space next to the Cancel button at the bottom of the sub-inspection. (This area is larger if the PictureMode and VideoMode properties for the sub-inspection are both Off.)

GainSeeker will dynamically size the font so that the entire text string is displayed.

This will persist across sub-inspections and inspections until the list of sub-inspections or inspections is displayed.

To clear the text string, set this to None or a blank string.

8.8

Submit, Cancel, Next inspection or sub-inspection, Shutdown

See also: cancelsubmit variable

Syntax

Example

Description/Remarks

New or
changed
in version

inspect.cursubi.cancel()

inspect.cursubi.cancel()

Cancels the current sub-inspection.

This is equivalent to clicking the Cancel button except that GainSeeker will not display the warning message about unsaved data being lost.

The inspection will advance properly based on the inspect.setnextsubi or inspect.setnextinspection commands.

8.8

inspect.cursubi.submit()

inspect.cursubi.submit()

This is equivalent to the user pressing the submit button, which triggers upon completing the current Python script. Submission fails if there are errors within the current sub-inspection.

 

inspect.setnextinspection(name, isPlannedInspection)

inspect.setnextinspection("Final Inspection")

After the inspector submits or cancels the current sub-inspection, PC Collect automatically opens the specified inspection ("Final Inspection").

inspect.setnextinspection("SKU 1400 Final Inspection", True)

After the inspector submits or cancels the current sub-inspection, PC Collect automatically opens the specified inspection planned inspection ("SKU 1400 Final Inspection").

inspect.setnextinspection(None)

After the inspector submits or cancels the current sub-inspection, PC Collect automatically displays the list of inspections.

inspect.setnextinspection(None, True)

After the inspector submits or cancels the current sub-inspection, PC Collect automatically displays the list of planned inspections.

Determines the inspection or planned inspection to open after the inspector submits or cancels the current sub-inspection.

name is the name of the Inspection or Planned Inspection to open. To display a list of Inspections or Planned Inspections, set this to None .

When isPlannedInspection is set to False, this command refers to Inspections. When set to True, it refers to Planned Inspections.

Overrides the CancelButtonBehavior sub-inspection property and inspect.setnextsubi command (below).

 

inspect.setnextsubi(name)

inspect.setnextsubi("sub-inspection name")

After the inspector submits or cancels the current sub-inspection, PC Collect automatically opens the specified sub-inspection.

inspect.setnextsubi(None)

After the inspector submits or cancels the current sub-inspection, PC Collect automatically displays the list of sub-inspections for the current inspection.

Determines the sub-inspection to open after the inspector submits or cancels the current sub-inspection.

Set to None to navigate back to the list of sub-inspections.

Overrides the AutoAdvance inspection property, CancelButtonBehavior sub-inspection property, and inspect.setnextinspection command (above).

 

inspect.shutdown()

inspect.shutdown()

Closes the PC Collect module and immediately stops execution of the script.

If executed by a Formula test with the FormulaMode property set to Post - which executes the formula after the data for the sub-inspection is submitted - the data will be submitted before the PC Collect module is closed.

8.7

Inspection data values

Syntax

Example

Description/Remarks

New or
changed
in version

inspect.cursubi.anchorpoint

inspect.cursubi.anchorpoint = True

Marks all SPC records on the current sub-inspection as an anchor point.

Gets or sets whether all SPC records on the current sub-inspection will be marked as an anchor point.

This property is initialized to False ("not an anchor point") when a sub-inspection is loaded and after a sub-inspection is submitted.

If this property is True, it sets the Anchor Point for the sub-inspection and overrides all test-specific settings for Anchor Point.

 

inspect.cursubi.getmedia()

mylist = inspect.cursubi.getmedia()

Gets a list of all media (image and video) file paths that have been attached to the current sub-inspection. If there are no media files attached, this returns None.

This makes it possible to send email and attach any images or video that are attached to the sub-inspection.

For an image captured within the sub-inspection (using the built-in device camera, web camera, etc.), this command creates a local temporary file and returns that file path. (These temporary files are removed after 24 hours.)

For an image or video file that the inspector attaches to the sub-inspection, this command returns the original file path.

9.3.2

inspect.cursubi.note

inspect.cursubi.note = "My note"

Gets or sets the current sub-inspection note.

 

inspect.datetime

inspect.datetime = "3/4/2015 13:45"

print inspect.datetime

Gets or sets the datetime for the inspection. This does not affect a Date/Time test on the current sub-inspection.

 

inspect.dmspartnumber

inspect.dmspartnumber = "My part"

print inspect.dmspartnumber

Gets or sets the DMS standard for the inspection.

For any sub-inspection, this is the equivalent of a DMS standard that was set by a DMS Standard test on a previous sub-inspection.

This is overridden by a DMS Standard test on the current sub-inspection.)

If the current sub-inspection has a DMS Standard test, use inspect.cursubi.dmspart(idx).partnumber to change the DMS standard instead of inspect.dmspartnumber.

Side panel charts for the sub-inspection will not reflect the new DMS standard until the inspector triggers a chart update by submitting data.

9.3

inspect.gettracevalue(index)

print inspect.gettracevalue(2)

Prints the traceability value for trace 2.

Returns the value of the specified traceability.

 

inspect.process

print inspect.process

Returns the Process property for the inspection.

8.8

inspect.setprocess(process, partno=None)

inspect.setprocess("P-MOLDING")

Sets the Inspection process to "P-MOLDING".


newproc = "M-CUT OFF"

newpart = "A-50 INSERT"

# setprocess sets part and proc regardless of if they exist or not

if not inspect.setprocess(newproc, newpart):

    # part/proc combo does not exist, create it

    stddms.partno = newpart

    stddms.process = newproc

    # set any other properties here

    stddms.storestd()

Sets the Inspection process to "M-CUT OFF" and the Inspection part number to "A-50 INSERT". If a standard does not exist for this combination, create the standard. If this process does not exist, create the process.


newproc = "M-CUT OFF"

newpart = "A-50 INSERT"

# set process

inspect.setprocess(newproc)

# update DMS Standard test; set part number for this subi and rest of inspection

inspect.cursubi.dmspart("part").partnumber = newpart

# update list of defects and sample size for Defect List test

stddms.loadstd(newpart, newproc)

inspect.cursubi.defectlist("defects").defects = stddms.getalldefectlabelsforproc()

inspect.cursubi.defectlist("defects").samplesize = stddms.samplesize

Sets the Inspection process to "M-CUT OFF".

Sets the DMS Standard test on this sub-inspection to the combination of Part Number "A-50 INSERT" and the new process.

Sets the Defect List test on this sub-inspection to display the defect list from the new process and the sample size from the new standard.

Sets the process - and optionally, the part number - for the inspection. The value(s) set by this command will be stored in the UniqueID.

Parameters:

process cannot be blank or None.

If you specify a partno, GainSeeker updates the current DMS standard with the new process and the new partno. You can specify a blank string to clear the partno.
If you do not specify a partno, GainSeeker only updates the process portion of the current DMS standard.

Return value:

This command always sets the DMS standard for the inspection - even if no DMS standard exists for this combination of partno and process. It returns True if a DMS standard exists for the resulting combination of partno and process. It returns False if there is no DMS standard for this combination of partno and process.

You should check this return value and use the stddms commands to create the standard and the process if they do not exist.

Notes:

This is easiest to implement by using an initial sub-inspection to run this command and set the process and part number, with no DMS Standard tests or tests that store DMS Data on the sub-inspection.

  • These values will be detected and used by all the other sub-inspections where you run all of your tests.

  • A DMS Standard test in a later sub-inspection will clear the original standard if it does not exist for the Part Number configured in the Inspection and the new Process set by this command.

If you must run this command on a sub-inspection that contains other tests, you must be aware of issues such as the following:

  • If the current sub-inspection has a DMS Standard test, this command will not change the Part Number shown on that test or the process used to display a list of DMS standards. If you use this command to change the partno, you should also use inspect.cursubi.dmspart(idx).partnumber to update the DMS Standard test. Please note that when the sub-inspection is submitted, any Part Number displayed on the DMS Standard test will override a Part Number set by this command - so best practice is to either set them to the same value or remove the DMS Standard test from the sub-inspection.

  • If the current sub-inspection has a Defect List test that displays the defects for the current process, this command will not update the defect buttons to reflect the new process. If desired, you can use the inspect.cursubi.defectlist(idx).defectlist command to do this. Similarly, you can use the inspect.cursubi.defectlist(idx).samplesize command to update the sample size to match the new standard.

  • Side panel charts that are linked to the Inspection Process (or to the Inspection Part Number and Process) will be updated to reflect the new process when this method is called.

9.1

9.3

inspect.settracevalue(index, value)

inspect.settracevalue(5, "Machine 345")

This sets traceability 5 to "Machine 345".

Sets the value of the specified traceability.

This is overridden by the corresponding Traceability test on the current sub-inspection.)

Side panel charts for the sub-inspection will not reflect the new traceability value until the inspector triggers a chart update by submitting data.

9.3

Other inspection commands

Syntax

Example

Description/Remarks

New or
changed
in version

inspect.cursubi.combinedfailureresponse

inspect.cursubi.combinedfailureresponse = "joanne@acme.com, andy@acme.com"

Gets or sets the CombinedFailureResponse property for this sub-inspection.

This can be set to a string of comma-delimited email addresses.

9.3

inspect.cursubi.getforcenote()

inspect.cursubi.getforcenote()

Gets the sub-inspection ForceNote property.

Gets the ForceNote property for the sub-inspection.

This property determines whether to require entry of notes and/or corrective actions when there is a defect or real-time failure on the sub-inspection. (Individual tests also have their own ForceNote properties which can override portions of this setting.)

Return value is a list in the format [ecat, note].

ecat will be one of these:

  • 0 - No corrective actions are required.

  • The sum of the individual corrective actions required:

    • 1 - Event

    • 2 - Cause

    • 4 - Action Taken

    • For example, when both Cause and Action Taken are required, ecat will be 6 (2 for Cause + 4 for Action Taken)

  • 8 - At least one of Event, Cause, or Action Taken is required.

note will be either True (require Note entry) or False (do not require Note entry).

9.1

inspect.cursubi.gettesttype(idx)

where idx is the TestID property of the test.

print inspect.cursubi.gettesttype("machine")

Finds the test where TestID = "machine" and returns the corresponding type of test (such as "TRACEABILITY").

Returns the type of test that corresponds to the specified TestID.

For a test type that cannot be modified by Python commands (such as Formula or Line Break), this will return None.

Otherwise, this command returns one of the following strings:

"NUMERICINPUT"

"DATETIME"

"TRACEABILITY"

"PASSFAIL"

"CHECKBOX"

"DEFECTLIST"

"DMSSTANDARD"

"TEXT"

"TIMER"

"RATING"

"FORMULABUTTON"

See also:

inspect.cursubi.testidlist

inspect.cursubi.ni(idx).rtfvalue

9.2

inspect.cursubi.name

print inspect.cursubi.name

Returns the name of the current sub-inspection.

 

inspect.cursubi.setforcenote(ecat, note)

inspect.cursubi.setforcenote(8, True)

Sets the sub-inspection ForceNote property.

    • Inspector will be required to enter at least one of Event, Cause, or Action Taken.

    • Inspector will be required to enter a Note.

inspect.cursubi.setforcenote(0, False)

Sets the sub-inspection ForceNote property to "None". No notes or corrective actions are required.

Sets the ForceNote property for the sub-inspection.

This determines whether to require entry of notes and/or corrective actions when there is a defect or real-time failure on the sub-inspection. (Individual tests also have their own ForceNote properties which can override portions of this setting.)

ecat must be one of these:

  • 0 - No corrective actions are required.

  • The sum of the individual corrective actions you want to require:

    • 1 - Event

    • 2 - Cause

    • 4 - Action Taken

    • For example, to require both Cause and Action Taken, specify an ecat of 6 (2 for Cause + 4 for Action Taken)

  • 8 - Require at least one of Event, Cause, or Action Taken.

note must be either True (require Note entry) or False (do not require Note entry).

After the sub-inspection closes, this returns to the setting stored in the inspection.

9.1

inspect.cursubi.testidlist

inspect.cursubi.testidlist

Returns an unordered list of the TestIDs for the tests in the current sub-inspection.

See also:

inspect.cursubi.gettesttype(idx)  

inspect.cursubi.ni(idx).rtfvalue

 

inspect.name

print inspect.name

Returns the name of the inspection.

 

inspect.persist["mykey"]

This first line of code is executed in one inspection:

inspect.persist["name"] = "Bob"

This second line of code is executed in another inspection:

print inspect.persist["name"]

The value printed on the second line should be "Bob"

Stores values between inspections. Variables are normally kept for the lifetime of a running inspection, so any information that must be passed between inspections may be stored using inspect.persist.

"mykey" must be a string and is case-sensitive.

For any "mykey", you can set its persistent value to a string or number.

Note: any data stored is not saved after the Inspection Viewer window closes.

 

inspect.plannedinspname

myval = inspect.plannedinspname

If running a planned inspection, this returns the name of the planned inspection.

If not running a planned inspection, this returns an empty string.

9.2

inspect.storerecords

inspect.storerecords = False

Disables automatic storage of data records when the user Submits the current sub-inspection.

Disables or enables automatic storage of data records when the user Submits the current sub-inspection.

Set to False to disable automatic storage or True to (re-)enable automatic storage. Opening each sub-inspection automatically resets this to True.

This lets you create a sub-inspection where the user enters information on the sub-inspection, but you read the data they entered and then use other Python commands to create and store whatever records you need.

See also: datadms, dataspc

 

inspect.subi(id).color

inspect.subi(2).color = "#FFA500"

Sets the color of the third sub-inspection to Orange.

 

inspect.subi("Weight checks").color = "Red"

Sets the color of the "Weight checks" sub-inspection to Red.

Sets or gets a custom background color for a sub-inspection when displayed in the list of sub-inspections.

  • If you set a custom background color for a sub-inspection, GainSeeker will not automatically change that color to indicate the sub-inspection status (Complete: #3CE646, Incomplete: #00D2FC, or Complete with Errors: #FF0F0F).

    If you clear the custom background color, GainSeeker will reset the sub-inspection's color to match its current status (Complete, Incomplete, or Complete with Errors).

  • If you use this command to get the sub-inspection color, it can only get a custom background color that you previously set with Python.
    It cannot get the colors that GainSeeker automatically applies to indicate the sub-inspection's current status (Complete, Incomplete, or Complete with Errors).

 

id must be either an integer that matches the Index property of a sub-inspection or a string that matches the Label property of a sub-inspection. If no sub-inspection matches the id you specify, this command will generate an error.

 

If used to set the custom color, you may specify the color's rgb (hex) value or its colorname. (For a full list of colornames - such as "red", "orange", "yellow", "green", "blue", "white", and many more - see https://www.colorcodehex.com/html-color-names.html or http://cng.seas.rochester.edu/CNG/docs/x11color.html.)

To clear the custom color, set this to None or a blank string.

 

If used to get the custom color, this returns the rgb (hex) value.

9.3.2

inspect.subi(id).visible

inspect.subi(2).visible = False

Sets the third sub-inspection to be hidden from the list of sub-inspections.

 

inspect.subi("Weight checks").visible = True

Sets the "Weight checks" sub-inspection to be visible in the list of sub-inspections.

Sets or gets the sub-inspection's VisibleInList property, which determines whether a sub-inspection should be visible or hidden in the list of sub-inspections.

 

id must be either an integer that matches the Index property of a sub-inspection or a string that matches the Label property of a sub-inspection. If no sub-inspection matches the id you specify, this command will generate an error.

 

To make the sub-inspection visible in the list of sub-inspection, set this to True .

To make the sub-inspection hidden from the list of sub-inspection, set this to False . (Remember that a hidden sub-inspection can still be launched by setting the AutoAdvance property of the Inspection, setting the AutoLoadSubInspection property of the sub-inspection, or running a Python script that executes inspect.setnextsubi() .)

9.3.2

inspect.subinspectionlist

mysubinspections = inspect.subinspectionlist

Returns the list of sub-inspection names in the order in which they appear (top to bottom) for the current inspection - including sub-inspections that are not visible.

8.9

inspect.uniqueid

print inspect.uniqueid

Returns the unique ID for this inspection.

You can configure GainSeeker to automatically clear unique IDs based on their age. However, if you want to delete the current unique ID immediately - for example, after the inspector indicates the inspection has been completed for this unique ID - see How to delete the current Unique ID.

 

inspect.update()

inspect.update()

A Python script that is programmed to change any part of the displayed inspection window will not actually update the display until the script completes.

You can use this command to force an update of the displayed inspection window during script execution.

 

How to delete the current Unique ID

When using the Unique ID to keep inspection settings such as traceability values entered, status of sub-inspections, etc., GainSeeker updates the Unique ID table with this inspection's latest information after the inspection closes. This means that you cannot use a Python script in the current inspection to delete that inspection's Unique ID. However, you can use the following technique to achieve the same result:

Step 1 - Set up a "Remove UniqueID" inspection

    1. Create a new Inspection and name it Remove UniqueID .

    2. On the first sub-inspection, set the AutoLoadSubInspection property to True .

    3. Add a Formula test to the first sub-inspection and configure its properties as follows:

    4. Save and publish this new inspection.

Step 2 - Add a formula to your data collection inspection

This formula asks the inspector to confirm that the inspection is complete for the current Unique ID. If complete, it runs the "Remove UniqueID" inspection.

    1. Edit the actual inspection whose Unique ID you want to delete when finished.

    2. Add a Formula test to the last sub-inspection and configure its properties as follows:

    3. Save and publish this inspection.

See also