Community
Hi all,
I need to update the ilogic that have to choose group of fold. Can anyone amend this ilogic code.
eg:- I need to fold 77 to 93
Dim oPDoc As PartDocument = TryCast(ThisDoc.Document, Inventor.PartDocument)
If oPDoc Is Nothing Then Logger.Debug(iLogicVb.RuleName & " exited (not a Part)") : Return
If oPDoc.SubType <> "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
Logger.Debug(iLogicVb.RuleName & " exited (not Sheet Metal)")
Return
End If
Dim oSMDef As SheetMetalComponentDefinition = oPDoc.ComponentDefinition
Dim oSMFeats As SheetMetalFeatures = oSMDef.Features
Dim oFoldFeatures As FoldFeatures = oSMFeats.FoldFeatures
For Each oFoldFeature As FoldFeature In oFoldFeatures
If oFoldFeature.Name = "Fold77" Then
If FOLD_DIRECTION = "UP" Then
oFoldFeature.Definition.IsPositiveBendDirection = False
Else
oFoldFeature.Definition.IsPositiveBendDirection = True
End If
End If
Next 'oFoldFeature
If oPDoc.RequiresUpdate Then oPDoc.Update2(True)
End Sub
Solved! Go to Solution.
Solved by A.Acheson. Go to Solution.
Hi @jerinc101
Maybe this will work for you
Replace this
For Each oFoldFeature As FoldFeature In oFoldFeatures
If oFoldFeature.Name = "Fold77" Then
If FOLD_DIRECTION = "UP" Then
oFoldFeature.Definition.IsPositiveBendDirection = False
Else
oFoldFeature.Definition.IsPositiveBendDirection = True
End If
End If
Next 'oFoldFeature
With
For Each oFoldFeature As FoldFeature In oFoldFeatures
For val As Integer = 77 to 93
Dim foldname as String = "Fold" &val
If oFoldFeature.Name = foldname Then
If FOLD_DIRECTION = "UP" Then
oFoldFeature.Definition.IsPositiveBend Direction = False
Else
oFoldFeature.Definition.IsPositiveBendDirection = True
End If
End If
Next
Next 'oFoldFeature
Can't find what you're looking for? Ask the community or share your knowledge.