Message 1 of 1
Rule compile error not member Integer: iLogic Hole pattern control
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I'm trying to add a hole pattern in a part (weather louvre) according a manufacturer datasheet (attached) but I'm getting compile errors: Value is not a member of Integer.
Hole pattern changes at certain steps, in width and height, I started with the Width.
I made the part, added User parameters T1, T2 and Gat_n (array distance) and made the sketch/feature for the first hole. After that added an array and used the User Parameters where needed.
This is what I have now (width only) but getting these compile errors.
Pattern for the height still to be added when this first step works.
' === Access the User Parameters === Dim louvreWidth As Double louvreWidth = ThisApplication.ActiveDocument.ComponentDefinition.Parameters.Item("Rooster_Breedte").Value ' Get the value for width (double type) ' Output values Dim Gat_n As Integer ' Hole count (replacing Gat_Aantal) Dim edgeDistanceT2 As Double ' Distance from the side of the louvre (double type) ' === Logic to Determine Hole Count (Gat_n) === If louvreWidth >= 165 And louvreWidth <= 384 Then Gat_n = 1 ElseIf louvreWidth >= 385 And louvreWidth <= 881 Then Gat_n = 2 ElseIf louvreWidth >= 882 And louvreWidth <= 1481 Then Gat_n = 3 ElseIf louvreWidth >= 1482 And louvreWidth <= 2081 Then Gat_n = 4 ElseIf louvreWidth >= 2082 And louvreWidth <= 2399 Then Gat_n = 5 Else ' Default or further logic for widths larger than 2399 Gat_n = 6 End If ' === Edge Distance (T2) Calculation === If Gat_n = 1 Then edgeDistanceT2 = louvreWidth / 2 ' Centered if only 1 hole Else edgeDistanceT2 = 80 ' Fixed offset for multiple holes End If ' === Spacing Calculation (T1) === If Gat_n > 1 Then ' Directly assign the calculated spacing to the T1 parameter ThisApplication.ActiveDocument.ComponentDefinition.Parameters.Item("T1").Value = (louvreWidth - 2 * edgeDistanceT2) / (Gat_n - 1) Else ' If there is only one hole, spacing is not necessary ThisApplication.ActiveDocument.ComponentDefinition.Parameters.Item("T1").Value = 0 End If ' === Writing back to User Parameters === ' Set values for Gat_n (hole count) and T2 (edge distance) ThisApplication.ActiveDocument.ComponentDefinition.Parameters.Item("Gat_n").Value = Gat_n ThisApplication.ActiveDocument.ComponentDefinition.Parameters.Item("T2").Value = edgeDistanceT2