iLogic Extract Material Physical Properties

iLogic Extract Material Physical Properties

b.mccarthy
Collaborator Collaborator
1,412 Views
9 Replies
Message 1 of 10

iLogic Extract Material Physical Properties

b.mccarthy
Collaborator
Collaborator

Hello.

 

Is it possible to extract a material's physical properties using iLogic? I.e.  Poisson's Ratio, Density, Yield Strength, etc.

 

Thank you.

0 Likes
Accepted solutions (1)
1,413 Views
9 Replies
Replies (9)
Message 2 of 10

TomaszDąbrowski
Enthusiast
Enthusiast
Accepted solution
Dim oDoc As PartDocument = ThisDoc.Document

Dim MatName As String = oDoc.ComponentDefinition.Material.Name
Dim PR As Double = oDoc.ComponentDefinition.Material.PoissonsRatio
Dim Den As Double = oDoc.ComponentDefinition.Material.Density
Dim YS As Double = oDoc.ComponentDefinition.Material.YieldStrength

MsgBox("Material " & MatName & " has Poisson's Ratio: " & PR & ", Density: " & Den & ", Yield Strength: " & YS)
0 Likes
Message 3 of 10

b.mccarthy
Collaborator
Collaborator

Perfect!

 

Thank you!!

0 Likes
Message 4 of 10

b.mccarthy
Collaborator
Collaborator

I noticed that there is discontinuity between the Inventor material database, and the values the code presents:

 

Inventor Material Specs for Mild Steel:

2021-09-26 377.jpg

 

Values reported by iLogic Code:

2021-09-26 378.jpg

 

The Material and Poisson's Ratio are good, but the Density and Yield Strength do not match. Why are the values so different, and what tweaks need to be made to the code to display the data correctly?

 

Thank you.

0 Likes
Message 5 of 10

TomaszDąbrowski
Enthusiast
Enthusiast

That is because the units are different.

Yield strength is given in MPa (mega Pascal)

Density is given in g/cm3 (gram per cubic centimeter)

0 Likes
Message 6 of 10

b.mccarthy
Collaborator
Collaborator

Ok. Can you add code that will convert the values prior to displaying the dialog?

 

TIA

0 Likes
Message 7 of 10

TomaszDąbrowski
Enthusiast
Enthusiast

ok

Dim oDoc As PartDocument = ThisDoc.Document

Dim MatName As String = oDoc.ComponentDefinition.Material.Name
Dim PR As Double = oDoc.ComponentDefinition.Material.PoissonsRatio
Dim DenMetric As Double = oDoc.ComponentDefinition.Material.Density
Dim DenImperial As Double = DenMetric*0.03613 
Dim YSMetric As Double = oDoc.ComponentDefinition.Material.YieldStrength
Dim YSImperial As Double = YSMetric * 145.04

MsgBox("Material " & MatName & " has Poisson's Ratio: " & PR & ", Density: " & DenImperial & " [lb/in3], Yield Strength: " & YSImperial & " [psi].")
0 Likes
Message 8 of 10

b.mccarthy
Collaborator
Collaborator

Thank you.

 

So iLogic does not contain a conversion expression? 

0 Likes
Message 9 of 10

TomaszDąbrowski
Enthusiast
Enthusiast

I was surprised to find out that there is such converter:

Dim oDoc As PartDocument = ThisDoc.Document

Dim MatName As String = oDoc.ComponentDefinition.Material.Name
Dim PR As Double = oDoc.ComponentDefinition.Material.PoissonsRatio
Dim DenMetric As Double = oDoc.ComponentDefinition.Material.Density
Dim DenImperial As Double = oDoc.UnitsOfMeasure.ConvertUnits(DenMetric,"g/(cm cm cm)","lb/(in in in)")
Dim YSMetric As Double = oDoc.ComponentDefinition.Material.YieldStrength
Dim YSImperial As Double = oDoc.UnitsOfMeasure.ConvertUnits(YSMetric, "MPa", "psi")

MsgBox("Material " & MatName & " has Poisson's Ratio: " & PR & ", Density: " & DenImperial & " [lb/in3], Yield Strength: " & YSImperial & " [psi].")
0 Likes
Message 10 of 10

b.mccarthy
Collaborator
Collaborator

Excellent!

 

Thank you.

0 Likes