Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
L.Greft
441 Views, 2 Replies

Activate a flat pattern Orientation through iLogic

I've made three orientations within the "Edit Flat Patter Definition" and I want to use iLogic to activate the correct orientation in a specific situation. I've found some code within the API help and tried to use that in different ways, but everytime I get a different error. I don't have (a lot of) experience with API, so I hope someone can help me with this and explain to me what I'm doing wrong.

 

I have 3 orientations named "Left", "Right" and "Middle" and I use the code below.

 

Dim partDoc As PartDocument = ThisApplication.ActiveDocument
Dim smDef As SheetMetalComponentDefinition = partDoc.ComponentDefinition

If SPLIT_AMOUNT = 1 Then
	smDef.FlatPattern.FlatPatternOrientations.ActiveFlatPatternOrientation.Activate("Left")
ElseIf SPLIT_AMOUNT = 2 Then
	smDef.FlatPattern.FlatPatternOrientations.ActiveFlatPatternOrientation.Activate("Right")
ElseIf SPLIT_AMOUNT = 3 Then
	smDef.FlatPattern.FlatPatternOrientations.ActiveFlatPatternOrientation.Activate("Middle")
End If

 

Inventor 2021.3.1

Check out my ideas: https://autode.sk/2TKe6LH
Labels (1)