iLogic for automatically running the "Unfold" feature (different from flat pattern) and automatically selecting "Add All Bends"

iLogic for automatically running the "Unfold" feature (different from flat pattern) and automatically selecting "Add All Bends"

chewy_robot
Contributor Contributor
522 Views
2 Replies
Message 1 of 3

iLogic for automatically running the "Unfold" feature (different from flat pattern) and automatically selecting "Add All Bends"

chewy_robot
Contributor
Contributor

I am looking for assistance in creating an iLogic rule where when ran, it will automatically use the "unfold" feature (found in the sheet metal tab, Modify section) and have it automatically choose the stationary reference (in my case it does not matter what is chosen as the stationary reference) then have it choose "Add All Bends". I have an ilogic rule that makes some cuts but I need it to run in the Folded Model view with the sheet metal part unfolded. I'm just trying to automate some steps here before that rule is ran. Additionally, I would like to add some iLogic code to "Refold" the part after my other iLogic rule is done. How do i access the unfold command? I seem to only find unfold commands relating to creating a flat pattern or the flat pattern view. Any help would be appreciated

chewy_robot_0-1730823647869.png

 

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

Curtis_Waguespack
Consultant
Consultant
Accepted solution

@chewy_robot , something like this should work.

 

hope that helps, Curtis

Dim oDoc = ThisDoc.Document

Dim oDef As SheetMetalComponentDefinition
oDef = oDoc.ComponentDefinition

Dim oFeatures As SheetMetalFeatures
oFeatures = oDef.Features

RefoldName = "iLogic-Refold"
UnfoldName = "iLogic-Unfold"

Try : oFeatures.Item(RefoldName).Delete : Catch : End Try
Try : oFeatures.Item(UnfoldName).Delete : Catch : End Try

Dim oFace As Face
For i = 1 To oDef.SurfaceBodies.Item(1).Faces.Count
	oFace = oDef.SurfaceBodies.Item(1).Faces.Item(i)
	Try
		oFeature = oFeatures.UnfoldFeatures.Add(oFace)
		oFeature.Name = UnfoldName
		oUnfoldFace = oFace
		Exit For
	Catch
	End Try
Next

'do your cut here
'do your cut here
'do your cut here
'do your cut here


oFeature = oFeatures.RefoldFeatures.Add(oUnfoldFace)
oFeature.Name = RefoldName

EESignature

Message 3 of 3

chewy_robot
Contributor
Contributor

Thank you @Curtis_Waguespack, this worked!