Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to check Face overlap between two component occurance in an assembly

1 REPLY 1
Reply
Message 1 of 2
Anonymous
245 Views, 1 Reply

How to check Face overlap between two component occurance in an assembly

Hi All, i am stuck with this issue since long need your help.

 

I have two slots where it has collection of 12 faces. i need to check whether the two slots are aligned at 90deg forming "L" shape arrangement.

So i thought to check with any of the faces in slot whether they overlap.

i tried checking with face vertices but unable to get exact overlap.

 

please share solution how can i check whether two faces overlap each other.

 

Thanks in advance.

 

1 REPLY 1
Message 2 of 2
Ralf_Krieg
in reply to: Anonymous

Hello

 

It's difficult to imagine the exact situation. Can you post screenshots of possible positions of the two slots or a simplified demo assembly?

A simple way would be just to check the angle between two faces of the slots. If you assign the name "SideFace" to one face of the slot and the two occurrences in the assembly are named Part:1 and Part:2, the iLogic below can return the angle.

 

Sub Main()
	Dim oAssDoc As AssemblyDocument = ThisDoc.Document
	Dim fp1 As FaceProxy
	Dim fp2 As FaceProxy
	
	For Each oOcc As ComponentOccurrence In oAssDoc.ComponentDefinition.Occurrences
		Select Case oOcc.Name
			Case "Part:1" : fp1 =GetProxy(oOcc)
			Case "Part:2" : fp2 =GetProxy(oOcc)
		End Select
	Next
	
	Dim oAngle As Double = 180/PI * ThisApplication.MeasureTools.GetAngle(fp1, fp2)
	MsgBox(oAngle & "°")
End Sub

Private Function GetProxy(ByVal oOcc As ComponentOccurrence) As FaceProxy
	Dim iLogicAuto = iLogicVb.Automation
	Dim namedEntities = iLogicAuto.GetNamedEntities(oOcc.Definition.Document )

	Dim o As Object
	If namedEntities.NameExists("SideFace") Then
		o = namedEntities.FindEntity("Sideface")
		f=TryCast(o,Face)
	End If
	
	If f Is Nothing Then Return Nothing
	
	oOcc.CreateGeometryProxy(f, GetProxy)
End Function

 


R. Krieg
RKW Solutions GmbH
www.rkw-solutions.com

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report