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=1, nend=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

nend : int; default=0)

the number of blank fields at the end of the line

Returns:
fields_out : List[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)[source]

Removes any trailing Nones from the card. Also converts empty strings to None. Allows floats & ints.

Parameters:
card : List[str]

the fields on the card as a list

Returns:
short_card : List[str]

the card with no trailing blank fields