Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SELECT GROUP OF FOLD IN ILOGIC

1 REPLY 1
SOLVED
Reply
Message 1 of 2
jerinc101
113 Views, 1 Reply

SELECT GROUP OF FOLD IN ILOGIC

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

 

 
 
1 REPLY 1
Message 2 of 2
A.Acheson
in reply to: jerinc101

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report