SteveDoyle2 / pyNastran

A Python-based interface tool for Nastran's file formats
Other
384 stars 147 forks source link

Fail to Add CBAR Element: RuntimeError: RuntimeError: field='[0.0, 0.0, 0.0]' is not 8 characters long...raw_value=[0.0, 0.0, 0.0] #751

Closed zhaoyangyingmu closed 9 months ago

zhaoyangyingmu commented 9 months ago

Hello guys! I am using PyNastran to output data to a bdf file. Here is my code:

model = BDF()
model.add_cbar(doc['eid'], doc['pid'], [doc['ga'], doc['gb']], doc['g0'],
                        doc['offt'], doc['pa'], doc['pb'], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0])
model.write_bdf(bdf_file_path)

However, I got an RuntimeError:

RuntimeError: field='[0.0, 0.0, 0.0]' is not 8 characters long...raw_value=[0.0, 0.0, 0.0]

When I changedthe code as:

model.add_cbar(doc['eid'], doc['pid'], [doc['ga'], doc['gb']], doc['g0'],
                        doc['offt'], doc['pa'], doc['pb'], [1, 1, 1], [1, 1, 1])

I got the same error:

RuntimeError: field='[1, 1, 1]' is not 8 characters long...raw_value=[1, 1, 1]

I am using v1.3.4! Is there any way to solve this problem? Many thanks!

zhaoyangyingmu commented 9 months ago

Sorry, I made a mistake. I should add x value.

model.add_cbar(doc['eid'], doc['pid'], [doc['ga'], doc['gb']], doc['x], doc['g0'],
                        doc['offt'], doc['pa'], doc['pb'], [1, 1, 1], [1, 1, 1])
zhaoyangyingmu commented 9 months ago

This issue is closed.