pyyeti.nastran.bulk.wtinclude¶
- pyyeti.nastran.bulk.wtinclude(f, path, current_path=None, max_length=72)[source]¶
Write a Nastran INCLUDE statement to a file.
If possible, the relative path from current_path to path will be used. The statement will be wrapped as needed such that no lines exceed the specified max_length.
- Parameters:
f (string or file_like or 1 or None) – Either a name of a file, or is a file_like object as returned by
open()orio.StringIO. Input as integer 1 to write to stdout. Can also be the name of a directory or None; in these cases, a GUI is opened for file selection.path (string or object that defines __fspath__) – The path to the file that will be included.
current_path (string or object that defines __fspath__; optional) – The path to the directory where the Nastran input file is located. If current_path is not specified, the output will use an absolute path.
max_length (integer; optional) – The max length of each line of the include statment.
Notes
The max_length parameter must be at least 24 to allow space for the INCLUDE statement on the first line.
Forward slashes will always be used as path separators. This ensures that relative paths will work on both Windows and Linux.
Examples
>>> from pyyeti import nastran >>> path = '/home/user1/model.blk' >>> current_path = '/home/user2' >>> nastran.wtinclude(1, path, current_path) INCLUDE '../user1/model.blk'