SELECT GROUP OF FOLD IN ILOGIC

SELECT GROUP OF FOLD IN ILOGIC

jerinc101
Contributor Contributor
184 Views
1 Reply
Message 1 of 2

SELECT GROUP OF FOLD IN ILOGIC

jerinc101
Contributor
Contributor

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

 

 
 
0 Likes
Accepted solutions (1)
185 Views
1 Reply
Reply (1)
Message 2 of 2

A.Acheson
Mentor
Mentor
Accepted 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

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes