Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
vpeuvion
in reply to: WCrihfield

Hi @WCrihfield . Thank you for your reply.

Here's a simplified example of what I'm trying to do.

In this example, I select the reference face, the part is fully unfolded and then the part is refolded.

I wish I could select just one bend for refolding. The oBends objectCollection would only contain the selected bend.

Do I have to select a face that belongs to the bend and from there find the FlatBendResult?

Sub main()
	Dim oPartDoc As PartDocument = ThisApplication.ActiveDocument
	Dim oSMCD As SheetMetalComponentDefinition = oPartDoc.ComponentDefinition
	Dim oSMF As SheetMetalFeatures = oSMCD.Features

	Dim oBends As Inventor.ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
	
	Dim oFace As Face
	oFace = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllPlanarEntities,"Sélectionner la face de référence")
	oSMF.UnfoldFeatures.Add(oFace)

	MessageBox.Show("refold")
	For i = 1 To oSMCD.FlatPattern.FlatBendResults.Count
		oBends.Add(oSMCD.FlatPattern.FlatBendResults.Item(i).Bend)
	Next
	oSMF.RefoldFeatures.Add(oFace,oBends)
	
End Sub