write_path Module
- Defines following useful methods:
write_include(filename, is_windows=True)
- pyNastran.bdf.write_path._split_path(abspath: str, is_windows: bool) tuple[str, ...][source]
Takes a path and splits it into the various components.
This is a helper method for
write_include
- pyNastran.bdf.write_path._split_pathi(term: str) str[source]
If the segment is >72 characters, split it. Nastran ignores whitespace, so split at a place where there’s not whitespace.
- pyNastran.bdf.write_path.write_include(filename: str | PurePath, is_windows: bool = None) str[source]
Writes a bdf INCLUDE file line given an imported filename.
- Parameters:
- filenamePathLike
the filename to write
- is_windowsbool; default=None
- True/FalseWindows has a special format for writing INCLUDE
files, so the format for a BDF that will run on Linux and Windows is different.
None : Check the platform
- For a model that will run on Linux:
- ..code-block:: python
fname = r’/opt/NASA/test1/test2/test3/ test4/formats/pynastran_v0.6/pyNastran/bdf/model.inc’ write_include(fname, is_windows=False)
- We want:
- ..code-block:: python
- INCLUDE /opt/NASA/test1/test2/test3/test4/formats/pynastran_v0.6/
pyNastran/bdf/model.inc