Suppress Row in part rectangular pattern

Suppress Row in part rectangular pattern

j.romo
Advocate Advocate
208 Views
1 Reply
Message 1 of 2

Suppress Row in part rectangular pattern

j.romo
Advocate
Advocate

Hello guys, Im struggling right now to suppress a specific Row  or rows in a Rectangular Pattern

I found a post that had a great code to suppress individual elemnts of a Pattern but cant find out how to supress a specifc row .

Any help would be apreciated...

Dim oPattern As RectangularPatternFeature
oPattern = ThisDoc.Document.ComponentDefinition.Features.RectangularPatternFeatures.Item("CUP_HOLE1_PATTERN")
 
Dim oElements As FeaturePatternElements = oPattern.PatternElements
Dim oNumElements = CUP1_PATT_SIDE * CUP1_PATT_UP

oElements(5).Suppressed = True
oElements(6).Suppressed = True
oElements(7).Suppressed = True
oElements(8).Suppressed = True


ThisDoc.Document.update

 

patt1.JPG

 

0 Likes
209 Views
1 Reply
Reply (1)
Message 2 of 2

j.romo
Advocate
Advocate

I some how cheated a little but this code works

Dim oPattern As RectangularPatternFeature
Dim oPatternType As String
'here I can select from diferent patterns in a parameter with the pattern names
oPatternType = HOLE_TYPE
oPattern = ThisDoc.Document.ComponentDefinition.Features.RectangularPatternFeatures.Item(oPatternType)
 
Dim oElements As FeaturePatternElements = oPattern.PatternElements
' here I get the number of occurrences 
Dim oNumElements = CUP1_PATT_SIDE * CUP1_PATT_UP
'i = MessageBox.Show(oNumElements, "My iLogic Dialog", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1)
Dim oVar1 As Integer
Dim oV1 As Integer
Dim oV2 As Integer


'here I type the number of row in my ilogic form
oVar1 = DELETE_ROW 

oV1 = ((oVar1-1) * (CUP1_PATT_UP))+1
oV2 = (oV1 + CUP1_PATT_UP)-1



'i = MessageBox.Show(oV1 & " " & oV2 , "My iLogic Dialog", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1)
For r = oV1 To oV2

'delete or undelete by a boolean user param
oElements(r).Suppressed = DELETE_UNDELETE

Next


ThisDoc.Document.Update
0 Likes