utils Module

defines:
  • fields_out = build_table_lines(fields, nstart=1, nend=0)

  • fields_out = wipe_empty_fields(card)

pyNastran.bdf.cards.utils.build_table_lines(fields, nstart: int = 1, nend: int = 0)[source]

Builds a table of the form:

DESVAR

DVID1

DVID2

DVID3

DVID4

DVID5

DVID6

DVID7

DVID8

etc.

UM

VAL1

VAL2

etc.

and pads the rest of the fields with None’s (e.g. at the end of the DVID8 line).

Parameters:
fields: list[int/float/str]

the fields to enter, including DESVAR

nstart: int; default=1

the number of blank fields at the start of the line

nendint; default=0)

the number of blank fields at the end of the line

Returns:
fields_outlist[str/None]

the values ready for card printing

Note

will be used for DVCREL2, DVMREL2, DVPREL2, RBE1, RBE3, DRESP2, DRESP3 ..

Warning

only works for small field format??? ..

pyNastran.bdf.cards.utils.wipe_empty_fields(card: list[str | int | float | None]) list[str | int | float | None][source]

Removes any trailing Nones from the card. Also converts empty strings to None. Allows floats & ints, but that’s not the intended value, though it is ok (it’s just extra work).

Parameters:
cardlist[str]

the fields on the card as a list

Returns:
short_cardlist[str]

the card with no trailing blank fields