Automatically Handling Syntax Erros

12 views
Skip to first unread message

Ben Crews

unread,
Feb 23, 2021, 12:34:20 PM2/23/21
to pyNastran Discuss
Hello! I just started using pyNastran today, and I have deck which has int values where MSC Nastran normally expects floats. Instead of fixing all these locations (there are a lot), I use the system parameter so Nastran can ignore the error. PyNastran doesn't seem to recognize this, and now I can't import my bdf. Is there a way to convert a deck for all these SyntaxErrors (built-in)?

```
>>> model.read_bdf('baseline.all')

SyntaxError: zoffset = '0' (field #7) on card must be a float or blank (not an integer).
card=['CTRIA3', '301471', '301003', '301466', '301468', '30071', '0', '0']
```

Oddly, I think it still imported everything, because I can get_bdf_stats(). Did it it only import up to that CTRIA3 301471?


Thanks,

Ben

Steven Doyle

unread,
Feb 24, 2021, 1:51:09 AM2/24/21
to pyNastran Discuss
There is not.  The code expects a properly formatted deck.  It's helps to avoid errors.

The easiest way to load it would just be to load your model into Patran and write it back out.  It should work then.



--
You received this message because you are subscribed to the Google Groups "pyNastran Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pynastran-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pynastran-discuss/3a9ded89-94e9-47c8-b833-77f39de37d06n%40googlegroups.com.

Ben Crews

unread,
Feb 24, 2021, 9:00:45 AM2/24/21
to pynastra...@googlegroups.com
Okay, thanks Steven!

You received this message because you are subscribed to a topic in the Google Groups "pyNastran Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pynastran-discuss/laNBvaEEzWw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pynastran-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pynastran-discuss/CADJnEGH7kbh1-2yA48-%3DMUumHpomG9Ejp2Paf-JT1tLa8RWO-A%40mail.gmail.com.


--
-Ben
Reply all
Reply to author
Forward
0 new messages