Model.filtertable#

Model.filtertable(keycolumns, keystring, table, targettable, valuecolumns)#

Filters unique cells of key strings of selected column(s) and generates a new table considering the indices of key strings in key columns.

Unless otherwise noted, all inputs are mandatory. They may be specified in any order.

Parameters:
  • keycolumns (hwStringList) – The key columns of the selected table, separated by commas. These must follow the same sequence as the keystring.

  • keystring (hwStringList) – The key strings of the selected columns, separated by commas. These must follow the same sequence as the keycolumns.

  • table (hwString) – The name of the input/source table.

  • targettable (hwString) – The name of the output/target table.

  • valuecolumns (hwStringList) – The value columns of the selected table, separated by commas. These must follow the same sequence as the keystring.

Example#

For a given sourcetable table, filter 2 from layerindex column, 2_3_0 from loadcase column and get elementid and TAU12 columns output to a new table named targTable#
import hm
import hm.entities as ent

model = hm.Model()

model.filtertable(
  keycolumns=["layerindex", "loadcase"],
  keystring=["2", "2_3_0"],
  table="sourcetable ",
  targettable="targTable",
  valuecolumns=["elementid", "TAU12"]
)