Find the adjacent faces of given edge or face

Find the adjacent faces of given edge or face

supriya_chaugule
Contributor Contributor
431 Views
2 Replies
Message 1 of 3

Find the adjacent faces of given edge or face

supriya_chaugule
Contributor
Contributor

Hiii.....I need to find the adjacent facec of edge or given face to do the chamfer .Can anybody suggest the code for the same?

 

0 Likes
Accepted solutions (1)
432 Views
2 Replies
Replies (2)
Message 2 of 3

Andrii_Humeniuk
Advisor
Advisor
Accepted solution

Hi @supriya_chaugule . Here's a code example to get a list of faces.

Sub main()
	Dim oDoc As PartDocument = ThisApplication.ActiveDocument
	Dim oFace As Face = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Pick the face")
	If oFace Is Nothing Then Exit Sub
	Dim listFaces As New List(Of Face)
	listFaces.AddRange(GetAdjacentFaces(oFace))
End Sub

Private Function GetAdjacentFaces(oFace As Face) As List(Of Face)
	Dim listFaces As New List(Of Face)
	For Each oEdge As Edge In oFace.Edges
		For Each oEdgFace As Face In oEdge.Faces
			If Not oEdgFace Is oFace Then listFaces.Add(oEdgFace)
		Next
	Next
	Return listFaces
End Function

 

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

0 Likes
Message 3 of 3

supriya_chaugule
Contributor
Contributor

Thanks @Andrii_Humeniuk  For the solution.

0 Likes