Showing results for 
Search instead for 
Do you mean 
Reply

How to get physical material of solid body ?

How to get physical material of solid body?

UF_...ask_phys_material_of_body(/*input:*/ tag_t body_tag, /*output:*/ tag_t * phys_mat_tag);

 

Thanks

 

1 REPLY

Re: How to get physical material of solid body ?

I have used something like this in the past if I just wanted to get the material name.

 

        Dim BodyCollector As BodyCollection = workPart.Bodies
        Dim listBodyMaterials As New List(Of String)

        For Each thisBody As Body In BodyCollector
            If thisBody.IsSolidBody.Equals(True) Then
                Try
                   Dim tagthisBody As String = thisBody.Tag
                   Dim strthisBodyMaterial As String = thisBody.GetStringAttribute("MATERIAL")
                   listBodyMaterials.Add(tagthisBody & "," & strthisBodyMaterial)
                Catch ex As Exception
                   ' BODY HAS NO MATERIAL ASSIGNED
                End Try
            End If
        Next