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] |
These commands affect a specific test on the current sub-inspection.
Syntax |
Example |
Description/Remarks |
New
or |
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:
|
9.1 |
Syntax |
Example |
Description/Remarks |
New
or |
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).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:
|
9.1 |
Syntax |
Example |
Description/Remarks |
New
or |
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:
|
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:
|
9.3 |
Syntax |
Example |
Description/Remarks |
New
or |
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:
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 |
These commands are only used for a Formula test with FormulaMode set to Click.
Syntax |
Example |
Description/Remarks |
New
or |
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 |
Syntax |
Example |
Description/Remarks |
New
or |
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.
|
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 Numeric Input 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.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:
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 |
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 |
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.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.
|
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:
For the note parameter:
|
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: |
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:
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. |
Syntax |
Example |
Description/Remarks |
New
or |
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:
|
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:
|
9.1 |
Syntax |
Example |
Description/Remarks |
New
or |
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:
Options for the return value are:
|
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:
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:
|
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.
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.
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:
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:
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:
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:
|
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:
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:
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:
|
9.1 |
Syntax |
Example |
Description/Remarks |
New
or |
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 |
Syntax |
Example |
Description/Remarks |
New
or |
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:
|
9.1 |
Syntax |
Example |
Description/Remarks |
New
or |
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:
|
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:
|
9.1 |
These commands affect the current inspection or sub-inspection.
These are the current commands for side panel items. See below for deprecated commands.
Syntax |
Example |
Description/Remarks |
New
or |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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("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:
Changes to the side panel are displayed after the Python script completes. |
8.9 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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:
|
8.9 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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:
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 = 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.
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("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:
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 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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("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:
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:
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 |
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 = 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("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:
|
Syntax |
Example |
Description/Remarks |
New
or |
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.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 = "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 = "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 |
See also: cancelsubmit variable
Syntax |
Example |
Description/Remarks |
New
or |
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("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() |
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 |
Syntax |
Example |
Description/Remarks |
New
or |
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.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 = "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. |
|
print inspect.process |
Returns the Process property for the inspection. |
8.8 |
|
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. 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.
If you must run this command on a sub-inspection that contains other tests, you must be aware of issues such as the following:
|
9.1 9.3 |
|
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 |
Syntax |
Example |
Description/Remarks |
New
or |
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() 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:
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: |
9.2 |
inspect.cursubi.name |
print inspect.cursubi.name |
Returns the name of the current sub-inspection. |
|
inspect.cursubi.setforcenote(8, True) Sets the sub-inspection ForceNote property.
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:
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 |
Returns an unordered list of the TestIDs for the tests in the current sub-inspection. See also: |
||
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. |
|
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 = 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. |
||
mysubinspections = inspect.subinspectionlist |
Returns the list of sub-inspection names in the order in which they appear (top to bottom) for the current inspection. |
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() |
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. |
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:
Create a new Inspection and name it Remove UniqueID .
On the first sub-inspection, set the AutoLoadSubInspection property to True .
Add a Formula test to the first sub-inspection and configure its properties as follows:
Set the FormulaMode property to Pre (the default).
Set the PythonScript property to a new script with the following contents:
tSQL = "DELETE FROM " + sql.tables.inspectionuniqueid + " WHERE UNIQUEID = '" + inspect.persist["uniqueid"] + "'"
sql.execute(tSQL)
inspect.setnextinspection("", False)
inspect.cursubi.cancel()
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.
Edit the actual inspection whose Unique ID you want to delete when finished.
Add a Formula test to the last sub-inspection and configure its properties as follows:
Set the FormulaMode property to Post.
Set the PythonScript property to a new script with the following contents:
if disp.twobutton("Logsheet Complete?", "Yes", "No", inspect.name) == 0 :
inspect.persist["uniqueid"] = inspect.uniqueid
inspect.setnextinspection("Remove UniqueID", False)
Save and publish this inspection.