Design Table Methods  

CloserSupConfig Method CloserInfConfig Function CloseValueSupInColumn Method
CloseValueInfInColumn Method MinInColumn Function MaxInColumn Method
LocateInColumn Method CellAsString Function CellAsBoolean Method
CellAsReal Method SetCell Method LocateInRow Method
Sheet.CloserConfig    

CloserSupConfig()  

Applies to a design table sheet. Returns the configuration which contains the smallest  values greater or equal to the values of the given arguments. When several configurations meet this condition, the method sorts out the possible configurations with respect to the column order as it is specified in the argument list. 

Syntax

sheet.CloserSupConfig(columnName: String, minValue: Literal, ...): Integer

The CloserSupConfig function takes the following arguments:

Arguments Description
columnName Must be put in quotes. At least, one couple of arguments columnNamei/minValuei is required
minValue Required. You must specify the units.

Example

Given the design table below:

  SketchRadius(mm) PadLim1(mm) PadLim2(mm)
1 120 60 10
2 130 50 30
3 120 60 25
4 140 50 40

The expression below:

Relations\DesignTable1\sheet_name.CloserSupConfig("PadLim1", 60mm, "SketchRadius", 120mm, "PadLim2", 20mm)

returns 3

CloserInfConfig()  

Applies to a design table sheet. Returns the configuration which contains the largest values less or equal to the values of the given arguments. When several configurations meet this condition, the method sorts out the possible configurations with respect to the column order as it is specified in the argument list.

Syntax

sheet.CloserInfConfig(columnName: String, maxValue: Literal, ...):Integer

The CloserInfConfig method takes the following arguments:

Arguments Description
columnName Must be put in quotes. At least, one couple columnName/maxValue is required
maxValue Required. You must specify the units.

Example

Given the design table below:

  SketchRadius(mm) PadLim1(mm) PadLim2(mm)
1 120 60 10
2 130 50 30
3 120 60 20
4 140 50 40

The statement below
Relations\DesignTable1\sheet_name.CloserInfConfig("PadLim1", 60mm, "SketchRadius", 130mm, "PadLim2", 40mm)
returns 3.

Explanations

The values of lines 1 , 2 and 3 are all less or equal to the values specified in the method arguments.

CloserValueSupInColumn()  

Applies to a design table sheet. Scans the values of a column and returns the greatest cell value which is the nearest to a specified one. Returns 0 if no value is found or if the method arguments are not properly specified.

Syntax

sheet.CloserValueSupInColumn(columnIndex: Integer, Value: Real)

The CloserValueSupInColumn method takes two arguments:

Arguments Description
columnIndex Required. Index of the table column. Integer from 1 to n.
Value Required. Value searched for. Must be a real.

Example

ValueSup=Relations\DesignTable1\sheet_name.CloserValueSupInColumn(1, 80mm)
Message("Closest sup value is # (0.08 is expected)", ValueSup)

 

CloserValueInfInColumn()  

Applies to a design table sheet. Scans the values of a column and returns the smallest cell value which is the nearest to a specified one. Returns 0 if no value is found or if the method arguments are not properly specified.

Syntax

sheet.CloserValueInfInColumn(columnIndex: Integer, value: Real): Real

The CloserValueInfInColumn function has two arguments:

Arguments Description
columnIndex Required. Number or index of the table column. Integer from 1 to n.
value Required. Value searched for. Must be a real.

Example

Message("Closest inf value is # ", Relations\DesignTable1\sheet_name.CloserValueInfInColumn(2,41mm))

 

MinInColumn()  

Applies to a design table sheet. Returns the smallest of a column values.  Returns 0 if the column specified is out of range.

Syntax

sheet.MinInColumn(columnIndex : Index): Real

where columnIndex is the column number.

Example

MinimumValue=MinInColumn(3)
Message("Minimum value is # (0  is expected)", MinimumValue)
/* you can use also */
Message("Minimum value is # (0 is expected)", MinInColumn(3))

Sample

KwrProgramDT.CATPart  

MaxInColumn()  

Applies to a design table sheet. Returns the greatest of a column values.  Returns 0 if the column does not contain numerical values or if the method arguments are not properly specified.

Syntax

sheet.MaxInColumn(columnIndex: Integer): Real

Example

MaximumValue=Relations\DesignTable1\sheet_name.MaxInColumn(1)
Message("Maximum value is # (0.150 is expected)", MaximumValue)

LocateInColumn()

Applies to a design table sheet. Returns the index of the first row which contains a specified value.  Returns zero if the value is not found or if the method arguments are not properly specified.

Syntax

sheet.LocateInColumn(columnIndex: Integer, value: Literal) : Integer

The LocateInColumn method has two arguments:

Arguments Description
ColumnNumber Required. Number or index of the table column. Integer from 1 to n.
Value Required. Value searched for. Can be a string or a boolean

Example

Line=Relations\DesignTable1\sheet_name.LocateInColumn(4,11mm)
if (Line == 0)
{
Message("No value found !!!")
}

CellAsString()  

Applies to a design table sheet. Returns the contents of a cell located in a column.  Returns an empty string if the cell is empty or if the method arguments are not properly specified.

Syntax

sheet.CellAsString(rowIndex: Integer, columnIndex: Integer): String

where rowIndex is the configuration number and columnIndex the column number.

Example

CString=Relations\DesignTable1\sheet_name.CellAsString(1,5)
if (CString == "")
 {
   Message("No value read !!!")
 }

CellAsBoolean()  

Applies to a design table sheet. Returns the contents of a cell located in a column intended for boolean values. Returns false if the cell does not contain a boolean or if the method arguments are not properly specified.

Syntax

sheet.CellAsBoolean(rowIndex: Integer, columnIndex: Integer): Boolean

The CellAsBoolean method has two arguments:

Arguments Description
rowIndex Required. Configuration number. Integer from 1 to n.
columnIndex Required. Index of the table column. Integer from 1 to n.

Example

Boolean2=Relations\DesignTable1\sheet_name.CellAsBoolean(1,5)
if (Boolean2 <> true)
{
  Message("Error !!!")
}

CellAsReal()  

Applies to a design table sheet. Returns the contents of a cell located in a column intended for real values.  Returns zero if the cell does not contain a real or if the method arguments are not properly specified.

Syntax

sheet.CellAsReal(rowIndex: Integer, columnIndex: Integer): Real

where rowIndex is the configuration number (integer from 1 to n) and columnIndex the column number.

SetCell()  

Enables you to fill in a cell at a given position in an Excel file or a tab file.

Note: the index must start at 1 for the (1,1) cell to be located at the left top corner.

Syntax

sheet.SetCell(IndexRow:Integer, IndexColumn:Integer, CellValue:Literal): Void 

LocateInRow()  

Applies to a design table sheet. Returns the index of the first row which contains a specified value.  Returns zero if the value is not found or if the method arguments are not properly specified.

Syntax

sheet.LocateInRow(rowIndex: Integer, value: Literal) : Integer

The LocateInRow method has two arguments:

Arguments Description
RowNumber Required. Number or index of the table row. Integer from 1 to n.
Value Required. Value searched for. Can be a string or a boolean

Sheet.CloserConfig()

Method enabling you to find the closest configuration of a design table according to criteria that mix greater than (or equal to) and smaller than (or equal to).

Where:

Example:

Sheet.CloserConfig("column1", "<", 10mm, "column2", ">=", 20deg, "column3", "!=", "standard") that can be interpreted as follows:
Find the configuration where:

Note that: