Sheet Metal, parameters, styles and iLogic
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
In an effort to automate as much as possible, I've recently dived into the world of iLogic without the slightest clue what I'm doing, and through the help of this forum I get a little bit further each time I make an attempt at something new.
Today I'm trying to set up an iLogic rule in my Sheet Metal template that modifies the current active style values for BendRadius and kFactor based on my selection of material and thickness. We use four different thicknesses of three different materials, so the code wrote looks like this:
MultiValue.SetList("Thickness", 1.25 mm, 1.5 mm, 2.5 mm, 3.0 mm)
BendRadius = 3 mm
UnfoldMethodType=kLinearUnfoldMethod
If iProperties.Material = "Stainless Steel" And
Thickness = 1.25 Then
kLinearUnfoldMethod.KFactor = 0.3862
ElseIf iProperties.Material = "Stainless Steel" And
Thickness = 1.5 Then
kLinearUnfoldMethod.KFactor = 0.3963
ElseIf iProperties.Material = "Stainless Steel" And
Thickness = 2.5 Then
kLinearUnfoldMethod.KFactor = 0.3862
ElseIf iProperties.Material = "Stainless Steel" And
Thickness = 3 Then
kLinearUnfoldMethod.KFactor = 0.41385
ElseIf iProperties.Material = "Steel" And
Thickness = 1.5 Then
kLinearUnfoldMethod.KFactor = 0.40835
ElseIf iProperties.Material = "Steel" And
Thickness = 2.5 Then
kLinearUnfoldMethod.KFactor = 0.4332
ElseIf iProperties.Material = "Steel, Galvanized" And
Thickness = 1.25 Then
kLinearUnfoldMethod.KFactor = 0.4363
ElseIf iProperties.Material = "Steel, Galvanized" And
Thickness = 1.5 Then
kLinearUnfoldMethod.KFactor = 0.421
End If
As of now it doesen't do much other than returning an error message stating that "object variable or "With"-block variable is not defined".
I've searched around this forum trying to find out what Inventor recognizes as kFactor in the code through a couple of posts similar to this and I had the code running without error at one point, but it didn't change the default kFactor, nor did it change the value of the BendRadius parameter. It did manage to set a mutivalue for the thickness though.
Any help appreciated 🙂