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.
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.
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
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.