Design Table Methods

You can use Design Table methods.

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

Arguments


  • columnName: Must be put in quotes. It must correspond to a name of a column of the table.
  • minValue: Required. You must specify the units.

Note: You can use this method with one couple (column name / value) or several couples.

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

Arguments


  • columnName: Must be put in quotes. It must correspond to a name of a column of the table.
  • maxValue: Required. You must specify the units.

Note: You can use this method with one couple (column name / value) or several couples.

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.

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


  • As the first parameter specified in the argument list is PadLim1, the method scans the lines 1, 2 and 3 and searches for the largest PadLim1 value which is less or equal to 60 mm. Two configurations meet the condition: configuration 1 and configuration 3.
  • As the second parameter specified is SketchRadius, the method scans the configurations 1 and 3 and searches for the largest SketchRadius value less or equal to 130 mm. Again, the function finds two configurations meeting the criteria.
  • Then it rescans lines 1 and 3 and searches for the largest PadLim2 value less or equal to 40mm. The result is line 3.

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)

Arguments


  • 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

Arguments


  • 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=sheet->MinInColumn(3)
Message(Minimum value is # (0  is expected), MinimumValue)
/* you can use also */
Message(Minimum value is # (0 is expected), MinInColumn(3))

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

Arguments


  • 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

Arguments


  • 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

Important: Note that this method is not available in the Formula, in the Rule and the Check editors.

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

Arguments


  • 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).

Arguments


  • The columnName<index> arguments match the columns names in the design table source file.
  • The sortMethod<index> are strings that can only take the following values : "<", "<=", ">", ">=", "==", "!="
  • The value<index> arguments can be either numerical values (the magnitude must correspond to the magnitude of a given column), or string values. If string values are used, the exact value is retrieved from the cells (the sortMethod is used only if it is "==" or "!=".) If sortmethod is not "==" or "!=", "==" is assumed.

Example

mport

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


  • the value in column1 is strictly smaller than 10mm,
  • where the value in column2 is greater than or equal to 20deg
  • where the value in column3 is different from the standard string.

Note that:


  • If several configurations are valid, you will find the configuration whose values are as close as possible to the "bounds". If still several configurations are valid, the first valid one is returned.
  • If no configuration is valid, the returned value is 0.

CreateSheet

Method used to create a volatile sheet that can be used in EKL to manipulate a sheet document stored in the database. The document is retrieved thanks to an identifier that is the row identifier in the Knowledge Resources Table in Project Resource Management.

Note: The awaited setup data name is the internal one.

Arguments


  • The name of the .xls or .txt file.

Example

In the example below, you are going to drive the Pad first length parameter using the CreateSheet keyword.


  1. Create an Excel file identical to the one below:


  2. Click and select Infrastructure > Project Resource Management.
  3. Right-click the Knowledge Resources category in the Setup Data Tables tab, and select Create a new Resource table.
  4. In the KnowledgeResourcesxxx table, click Add a new resource item. A new resource is added to the table.
  5. Double-click the Logical Name cell and enter the resource name, Resource1 in our example.
  6. Double-click the Resource Type cell and select Sheet in the scrolling list.
  7. Click the From file tab, double-click the Resource cell and click Import in the Select a Sheet for item Resource1 dialog box. Click OK twice.
  8. Assign Knowledge Resources to the current project.
  9. Create a 3D Representation containing a Pad.
  10. Enter the Knowledge Advisor workbench and create an Action. Enter the following arguments into the editor and click OK when done.

  11. Right-click the action in the tree and select Action.1 object > Run.
  12. Make the appropriate selection in the geometry area and in the tree. The Pad First length is driven by the parameters entered in the Excel file.

ImportAttributes

Function used to import attributes. This function is the equivalent of the Import button in the Formula editor.

Syntax

Sheet->ImportAttributes(Father: Feature): List

Example

let DT(SheetType)
DT=CreateSheet("KnowledgeResources|AAA")
DT->ImportAttributes(PartBody)