Mechanical API for "Table" Objects

Mike.Thompson
Mike.Thompson Member, Employee Posts: 366
25 Answers 100 Comments Second Anniversary 25 Likes
✭✭✭✭
edited April 2024 in Structures

Hello,
Here is an example of a simple API for creating a "Table" object in Mechanical. These are available as of 24.1 release:

TableGroup = Model.AddTableGroup()

Tables = list(TableGroup.Children)
for T in Tables:
try:
ExtAPI.DataModel.Remove(T)
except Exception as e:
pass

Table = TableGroup.AddTable()
TimeEnum = MechanicalEnums.Table.VariableType.Time
TimeClassification = MechanicalEnums.Table.VariableClassification.Independent
PressureEnum=MechanicalEnums.Table.VariableType.Pressure
PressureClassification = MechanicalEnums.Table.VariableClassification.Real

Table.CreateAndAddColumn(TimeEnum, TimeClassification, None, None, 'Time')
Table.CreateAndAddColumn(PressureEnum, PressureClassification, None, None, 'Pressure')
Table.Name = "New Table"
Table.SendToSolver = True
Table.APDLName = "MyTable"

NumRows = Table.RowCount
with Transaction(True):
for i in range(3):
Table.TryInsertRow(NumRows+i,[i+1,i+1])

Tagged:

Comments

  • BenHett
    BenHett Member Posts: 3
    First Anniversary First Comment
    **

    Currently, as of 2024R2 there are tables for pressures and structural temperatures. Is there a plan to add Heat Transfer Coefficients and Tbulk for Heat Transfer. There are several times we use spatial varying loads and HTC and Tbulk in tables are ideal. I am working through HT processes now and don't see anyway to do it effectively without tables. I know imported loads can be used, but it really isn't worthwhile to do it that way because the mapping routines don't do well with sparse clouds.

    I think it would be a pretty quick update to the HT module using a lot of the code from the structures module. We need tables in HT and also ability to apply those for convection loads. Can this be added to a development list somewhere if it is not already there?

    Is there any work around?