11-08-2021
07:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
11-08-2021
07:05 AM
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
Solved! Go to Solution.