Material Names

24 views
Skip to first unread message

James Cook

unread,
Jul 30, 2024, 1:23:10 PM7/30/24
to pyNastran Discuss
So I know we can request for material names and it will return MAT1 or MAT11 or others depending on the material type, but is there a function that will return the actual material name that is assigned, i.e. Aluminum_6061? The attached photo, I have boxed in red what I am trying to return. ideally, trying to print the element ID along with the actual material name, vs the MAT 1 or MAT 11 etc. Let me know if there needs to be more clarification.Material_Name.png


Steven Doyle

unread,
Jul 30, 2024, 1:30:55 PM7/30/24
to pynastra...@googlegroups.com
You can access comments from the MAT1 object to get material name, but you’d have to parse it yourself.

comment = model.material[2].comment
name = comment.split(“:”)[1].strip()

There is a function to lookup ids by material id, but I’m out of town at the moment.

On Tue, Jul 30, 2024 at 7:23 AM James Cook <jam4...@gmail.com> wrote:
So I know we can request for material names and it will return MAT1 or MAT11 or others depending on the material type, but is there a function that will return the actual material name that is assigned, i.e. Aluminum_6061? The attached photo, I have boxed in red what I am trying to return. ideally, trying to print the element ID along with the actual material name, vs the MAT 1 or MAT 11 etc. Let me know if there needs to be more clarification.Material_Name.png


--
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/b767355b-3eb2-4f02-92df-2be1f0c3f4c0n%40googlegroups.com.

James Cook

unread,
Jul 31, 2024, 9:53:34 AM7/31/24
to pyNastran Discuss
Thank you for the quick reply. I will parse myself. Thank you! I will also search for the function to lookup ids by mat ids! Thanks again!
Reply all
Reply to author
Forward
0 new messages