Python scripting OLP - Objects

CENPyOlpAttributeTable

Previous  Chapter  Next

 

Methods

 

SetOlpProperty(iOlpProperty: unsigned int)

 

o

iOlpProperty

OLP attribute use level. Is a bitmask and can be a combination of one ore more levels. (see Attribute use level )

 

Sets Olp Property of attribute.

 

[Example]

myAttrib.SetOlpProperty( USER_ATTRIBUTE | PROCESS_ATTRIBUTE | GLOBAL_ATTRIBUTE )

 


 

GetVisibility(): bool

 

o

return

visibility status from attribute

 

Get visibility status of attribute.

 

[Example]

myAttrib.GetVisibility()

 


 

SetVisibility (visible: bool)

 

o

visible

visibility status to attribute

 

Set visibility status of attribute.

 

[Example]

myAttrib.SetVisibility(True)

 


 

GetName(): string

 

o

return

current name of the attribute

 

Get name of attribute.

 

[Example]

name = myAttrib.GetName()

 


 

SetName(name: string)

 

o

name

new name for the attribute

 

Set name of attribute.

 

[Example]

myAttrib.SetName("NewAttributeName")

 


 

IsValid(): bool

 

o

return

if attribute is valid

 

Checks if attribute is valid.

 

[Example]

if myAttrib.IsValid():

  # Attrib is OK

 


 

SetReadOnly(readOnly: bool)

 

o

readOnly

if attribute should be read only

 

Sets read only status of attribute.

 

[Example]

myAttrib.SetReadOnly(true)

 


 

GetReadOnly(): bool

 

o

return

read only status of attribute

 

Gets read only status of attribute.

 

[Example]

isReadOnly = myAttrib.GetReadOnly()

 


 

SetReComputeEnterState(reComputeEnterState: ReComputeEnterStates)

 

 

o

reComputeEnterState

Enter state of recompute triggered bu change of this attribute value. (see ReComputeEnterStates )

 

[Example]

myAttrib.SetReComputeEnterState( ENTERSTATE_COMPLETE )

 


 

GetReComputeEnterState(): Int

 

o

return

Enter state of recompute triggered bu change of this attribute value. (see ReComputeEnterStates )

 

[Example]

reComputeEnterState = myAttrib.GetReComputeEnterState()

 


 

AddColumn(name: string, type: ColumnType): int

 

o

name

name of column

 

o

type

type of column

 

o

return

number of columns (inclusive new one)

 

Adds a new column to the table attribute.

 

[Example]

amountColumns = myTable.AddColumn("ID", COLUMNTYPE_STRING)

 


 

AddRow(): int

 

o

return

number of rows (inclusive new one)

 

Adds new row to the table attribute. Cells will be filled with default values. (int: 0; double: 0.0; bool: false; string: "")

 

[Example]

amountRows = myTable.AddRow()

 


 

GetColumnType(columnNumber: int): ColumnType

 

o

columnNumber

number of column to get the type of

 

o

return

type of column

 

Gets the type of a specific column.

 

[Example]

typeOfFirstColumn = myTable.GetColumnType(0)

 


 

GetColumnName(columnNumber: int): string

 

o

columnNumber

number of column to get the name of

 

o

return

name of column

 

Gets the name of a specific column.

 

[Example]

nameOfFirstColumn = myTable.GetColumnName(0)

 


 

GetColumnSize(): int

 

o

return

number of columns

 

Get the number of columns of the table attribute.

 

[Example]

amountColumns = myTable.GetColumnSize()

 


 

GetRowSize(): int

 

o

return

number of rows

 

Get the number of rows of the table attribute.

 

[Example]

amountRows = myTable.GetRowSize()

 


 

GetCell(columnNumber: int, rowNumber: int): object

 

o

columnNumber

specific column

 

o

rowNumber

specific row

 

o

return

value of specific cell (int, double, bool or string)

 

Gets value of a specific cell.

 

[Example]

valueOfFirstRowAndColumn = myTable.GetCell(0,0)

 


 

SetCell(columnNumber: int, rowNumber: int, value: object)

 

o

columnNumber

specific column

 

o

rowNumber

specific row

 

o

value

value for specific cell (int, double, bool or string)

 

Sets value of a specific cell. Value has to be the same type as the column.

 

[Example]

myTable.SetCell(0,0,"test")

 


 

GetCellType(columnNumber: int, rowNumber: int): ColumnType

 

o

columnNumber

specific column

 

o

rowNumber

specific row

 

o

return

type of specific cell

 

Gets type of a specific cell.

 

[Example]

typeOfCell = myTable.GetCellType(0,0)

 


 

SetImportScriptName(importScriptName: string)

 

o

importScriptName

Python file name for script to import table values

 

Sets importScriptName of table attribute.

 

[Example]

myTable.SetImportScriptName("ImportFile.py")

 


 

SetExportScriptName(exportScriptName: string)

 

o

exportScriptName

Python file name for script to export table values

 

Sets exportScriptName of table attribute.

 

[Example]

myTable.SetExportScriptName("ExportFile.py")

 


 

SetImportFilePath(importFilePath: string)

 

o

importFilePath

Path to a file which should be imported

 

Sets importFilePath of table attribute.

 

[Example]

myTable.SetImportFilePath("C:\\USER\\FILE.tid")

 


 

GetImportFilePath(): string

 

o

return

Path to a file which should be imported

 

Gets importFilePath of table attribute.

 

[Example]

importFilePath = myTable.GetImportFilePath()

 


 

GetRowNumberById(id: string): int

 

o

id

ID of row

 

o

return

Row index

 

Gets row index of table attribute where the ID matches the row ID. If there is no row with the given ID then -1 will be returned.

 

[Example]

rowNumber = myTable.GetRowNumberById("ID")

 


 

GetRowValuesById(id: string): list

 

o

id

ID of row

 

o

return

List with all objects/values of the specific row

 

Gets all values of the specific row with the given ID of the table attribute.

 

[Example]

values = myTable.GetRowValuesById("ID")

 


 

GetRowValues(rowIndex: int): list

 

o

rowIndex

Index of a specific row

 

o

return

List with all objects/values of the specific row

 

Gets all values of the specific row of the table attribute.

 

[Example]

values = myTable.GetRowValues(0)

 


 

DeleteRow(rowIndex: int)

 

o

rowIndex

Index of a specific row

 

Deletes row at the given index.

 

[Example]

myTable.DeleteRow(0)

 


 

DeleteAllRows()

 

Deletes all rows of the table attribute.

 

[Example]

myTable.DeleteAllRows()

 


 

ClearTable()

 

Deletes whole content of table, rows and columns.

 

[Example]

myTable.ClearTable()

 


 

SetTableIconName(tableIconName: string)

 

o

tableIconName

Name of icon for table attribute

 

Sets icon name of table attribute.

 

[Example]

myTable.SetTableIconName("name")

 


 

GetTableIconName(): string

 

o

return

Icon name of table attribute

 

Gets icon name of table attribute.

 

[Example]

iconName = myTable.GetTableIconName()

 


 

GetColumnValueType(columnNumber: int): ATTRIBUTE_TYPE

 

o

columnNumber

Number of a specific column

 

o

return

Attribute type of this column

 

Gets attribute type of column.

 

[Example]

type = myTable.GetColumnValueType(0)

 


 

GetCellValueType(columnNumber: int, rowNumber: int): ATTRIBUTE_TYPE

 

o

columnNumber

Number of a specific column

 

o

rowNumber

Number of a specific row

 

o

return

Attribute type of this column

 

Gets attribute type of cell.

 

[Example]

type = myTable.GetCellValueType(0,0)

 


 


Previous
Previous page
Chapter
Chapter page
Next
Next page