It's possible to calculate a contact area between two pieces?

It's possible to calculate a contact area between two pieces?

macunaZMPXK
Explorer Explorer
254 Views
4 Replies
Message 1 of 5

It's possible to calculate a contact area between two pieces?

macunaZMPXK
Explorer
Explorer

Hi, I'm trying to get the surface area (contact area) between two pieces that are not overlappded, they just in a mate relationship, but not all of the surface area of each piece.

 

 

It's possible?

 

I just started using Ilogic, so I still rely on gpt for some scripts.

 

Tried to get one with gpt, but didn't get it right. Last Script i tried had this error:
Public member 'IsSolid' on type 'Face' not found.

Attaching the code and a image of that i refered when i say contact area, just to make myself clear.

 

Hope anyone can help me to get this.

 

Using Autodesk Inventor Professional 2025.

0 Likes
255 Views
4 Replies
Replies (4)
Message 2 of 5

C_Haines_ENG
Collaborator
Collaborator

Could you describe your desired workflow better? I know you want to get the contact area, but between what? Two faces? two solids? a bunch of solids? 

0 Likes
Message 3 of 5

macunaZMPXK
Explorer
Explorer

Indeed. 

It's between two solids. (2 IPT that has a mate constrain)
I usually calculate it manually, when I design buss bar.

0 Likes
Message 4 of 5

C_Haines_ENG
Collaborator
Collaborator

While this is technically possible, its wildly complicated and very "per-use". There is unfortunately no "Difference of Areas" command for iLogic, and Chat GPT is just trying to grab the area of a face. I attempted to write some code but its absolutely not what you're looking for. It will get the smallest area of the two components selected in an assembly, so long as a mate constraint was used. In order to fully complete this program you would have to create a sketch on one of the faces, project both faces onto it, find the correct closed profile, and get its area. 

 

Maybe some smarter programmers can help you with that.

Sub Main

	Dim oAsm As AssemblyDocument = ThisDoc.Document

	Dim oPart1 As ComponentOccurrence = ThisApplication.CommandManager.Pick(kAssemblyLeafOccurrenceFilter, "Select Part 1")
	Dim oPart2 As ComponentOccurrence = ThisApplication.CommandManager.Pick(kAssemblyLeafOccurrenceFilter, "Select Part 2")

	Dim oFace1 As Face, oFace2 As Face

	For Each oConstraint As AssemblyConstraint In oPart1.Constraints

		If oConstraint.AffectedOccurrenceOne Is oPart1 Or oConstraint.AffectedOccurrenceTwo Is oPart1
			If oConstraint.AffectedOccurrenceOne Is oPart2 Or oConstraint.AffectedOccurrenceTwo Is oPart2
				oFace1 = oConstraint.EntityOne
				oFace2 = oConstraint.EntityTwo
				Exit For
			End If
		End If

	Next
	
	Dim oAreas As New List(Of Double)
	oAreas.AddRange({oFace1.Evaluator.Area,oFace2.Evaluator.Area})
	
	MsgBox("SMALLEST AREA: " & oAreas.Min & "cm^2")

End Sub

 

0 Likes
Message 5 of 5

macunaZMPXK
Explorer
Explorer

Oh I see.


Thanks for your answer and your code, I'll check it.

0 Likes