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: 

Sheet Metal Unfold kFactor by custom equation

1 REPLY 1
Reply
Message 1 of 2
Anonymous
627 Views, 1 Reply

Sheet Metal Unfold kFactor by custom equation

Anonymous
Not applicable

Hello,

 

In VBA I try to add an new unfold method as custom equation.

    Dim okFactorUnfoldMethod As unfoldMethod
    Set okFactorUnfoldMethod = oSheetMetalCompDef.UnfoldMethods.AddEquationUnfoldMethod("KFactorRVS")

 So far it works fine.

After that I want to change the values but I don't know how to do that.

I found the next equation, but don't know how to get it work.

 

SetEquation(1, kBendkFactorEquationType, "0,06+ 0,25*log(<Radius\>/<Thickness\>)", 0, kGreaterThanComparisonType, , 180, kLessThanOrEqualToComparisonType)

 I hope someone knows how to do this. Thanks.

 

0 Likes

Sheet Metal Unfold kFactor by custom equation

Hello,

 

In VBA I try to add an new unfold method as custom equation.

    Dim okFactorUnfoldMethod As unfoldMethod
    Set okFactorUnfoldMethod = oSheetMetalCompDef.UnfoldMethods.AddEquationUnfoldMethod("KFactorRVS")

 So far it works fine.

After that I want to change the values but I don't know how to do that.

I found the next equation, but don't know how to get it work.

 

SetEquation(1, kBendkFactorEquationType, "0,06+ 0,25*log(<Radius\>/<Thickness\>)", 0, kGreaterThanComparisonType, , 180, kLessThanOrEqualToComparisonType)

 I hope someone knows how to do this. Thanks.

 

1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

Anonymous
Not applicable

I've tried some more things, bur it is still not working. SetEquation gives a problem: Invalid procedure call or argument.

My code so far is:

Public Sub kFactorUnfoldMethod()

    Dim oPartDoc As PartDocument
    Set oPartDoc = ThisApplication.ActiveDocument

    Dim oSheetMetalCompDef As SheetMetalComponentDefinition
    Set oSheetMetalCompDef = oPartDoc.ComponentDefinition

    ' Create a new unfold method.
    Dim okFactorUnfoldMethod As unfoldMethod
    Set okFactorUnfoldMethod = oSheetMetalCompDef.UnfoldMethods.AddEquationUnfoldMethod("KFactorRVS")
        okFactorUnfoldMethod.BendAngleType = kBendingAngleType
        Call okFactorUnfoldMethod.SetEquation(1, kBendkFactorEquationType, "0,06+ 0,25*log(<Radius\>/<Thickness\>)", , kGreaterThanComparisonType, , , kLessThanOrEqualToComparisonType)
        oSheetMetalCompDef.unfoldMethod = okFactorUnfoldMethod
        
End Sub

 I'm not an expert in VB, so I hope someone knows what i,am doing wrong.

 

Wim

 

0 Likes

I've tried some more things, bur it is still not working. SetEquation gives a problem: Invalid procedure call or argument.

My code so far is:

Public Sub kFactorUnfoldMethod()

    Dim oPartDoc As PartDocument
    Set oPartDoc = ThisApplication.ActiveDocument

    Dim oSheetMetalCompDef As SheetMetalComponentDefinition
    Set oSheetMetalCompDef = oPartDoc.ComponentDefinition

    ' Create a new unfold method.
    Dim okFactorUnfoldMethod As unfoldMethod
    Set okFactorUnfoldMethod = oSheetMetalCompDef.UnfoldMethods.AddEquationUnfoldMethod("KFactorRVS")
        okFactorUnfoldMethod.BendAngleType = kBendingAngleType
        Call okFactorUnfoldMethod.SetEquation(1, kBendkFactorEquationType, "0,06+ 0,25*log(<Radius\>/<Thickness\>)", , kGreaterThanComparisonType, , , kLessThanOrEqualToComparisonType)
        oSheetMetalCompDef.unfoldMethod = okFactorUnfoldMethod
        
End Sub

 I'm not an expert in VB, so I hope someone knows what i,am doing wrong.

 

Wim

 

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

Post to forums  

Autodesk Design & Make Report