Content Centre Change Size

Content Centre Change Size

donald_leigh
Enthusiast Enthusiast
1,090 Views
10 Replies
Message 1 of 11

Content Centre Change Size

donald_leigh
Enthusiast
Enthusiast

I found the attached rule (Changed to suit my needs) via YouTube user “Automation With iLogic

The rule is working almost. How I want the rule to work is 1: Select Bolt Size, 2: Select Bolt Length based only on bolt size

When I select the Size, the next list box displays all the available sizes not only for the size selected. Eg, M6 might be 30 to 50, M8 might be 40 to 80, M10 might be 50 to 100. When I select M6 it returns lengths 30 to 100. when I want only 30 to 50 returned.

Anyone able to help me out.

0 Likes
Accepted solutions (2)
1,091 Views
10 Replies
Replies (10)
Message 2 of 11

A.Acheson
Mentor
Mentor
Accepted solution

Hi @donald_leigh 

In your second list before adding the cell value check the previous selected Size value is a value in it's column and row.

If Not List2.Contains(Val2) AndAlso Val1 = oRow.GetCellValue(sCol1)Then
   List2.Add(Val2)
End If 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 11

donald_leigh
Enthusiast
Enthusiast

thanks @A.Acheson 

0 Likes
Message 4 of 11

donald_leigh
Enthusiast
Enthusiast

@A.Acheson, Any chance you can help again please? I would like to be able to return just 1 cell value based on a row and column value. not the whole column. 

 

Eg. for a nut in the content center, I want to return the height of the nut (Found in the column) based on the size (Found on a row)

 

Cheers

Donald

0 Likes
Message 5 of 11

A.Acheson
Mentor
Mentor

Hi @donald_leigh 

 

You can record the ContentTableRow index that you found a certain value on and then check the row index again of a specific column for the cell value. 

Syntax

ContentTableRow.Index() As Long

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 6 of 11

donald_leigh
Enthusiast
Enthusiast

Hi @A.Acheson, Again thanks for your help

 

I would class myself as an intermediate beginner with Ilogic. I have been looking at the ContentTableRow index but have not been able to get this working.

 

Could you offer any more help please.

 

Donald

0 Likes
Message 7 of 11

A.Acheson
Mentor
Mentor

Can you share the code your using and where you want to input your value?

If you have all the criteria in a logic then there should be only one row that matches the criteria you select. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 8 of 11

donald_leigh
Enthusiast
Enthusiast

Morning @A.Acheson.

 

I have attached the Ilogic rule that find all the available sizes of the nut in the CC. Once the size is selected I would like to be able to return the Thickness of the nut. This is referenced by the "KOH" parameter  

 

Again, Thanks heaps for the help.

 

Donald

0 Likes
Message 9 of 11

A.Acheson
Mentor
Mentor
Accepted solution

Hi @donald_leigh 

 

You need to loop over the family rows again in order to get the row object of the size value selected. This is because you select the size after the first row loop and have no way to reference the row again.

iLogicVb.UpdateWhenDone = True

MultiValue.SetValueOptions(True, DefaultIndex := 0)

If NutType = "Plain Nut" Then
	NutChild = "Hex"
Else
	NutChild = "Locking Nuts"
End If

'CC Family Name
If NutType = "Plain Nut" Then
	If Material = "Black (Plain)" Or Material = "Zinc Plated" Then
			NutTypeName = "HEX NUT"
	Else If Material = "G304" Or Material = "G316" Then
			NutTypeName = "HEX NUT - S/S"
	End If
Else
	If Material = "Black (Plain)" Or Material = "Zinc Plated" Then
			NutTypeName = "HEX NYLOC NUT"
	Else If Material = "G304" Or Material = "G316" Then
			NutTypeName = "HEX NYLOC NUT - S/S"
	End If
End If

Components.ContentCenterLanguage = "en-US"
Dim oC As ContentCenter = ThisApplication.ContentCenter
Dim oCN As ContentTreeViewNode = oC.TreeViewTopNode
'CC Folders
oCN = oCN.ChildNodes.Item("Fasteners").ChildNodes.Item("Nuts").ChildNodes.Item(NutChild)

Dim oColumn As ContentTableColumn
Dim oRow As ContentTableRow
Dim oFam As ContentFamily
Dim oChosenFamily As ContentFamily
Dim FamName As String = NutTypeName
Dim sCol1 As String = "SIZE_SEL"
Dim sCol2 As String = "KOH"
Dim Val1 As String
Dim thick As String
Dim List1 As New ArrayList

For Each oFam In oCN.Families
	
	If oFam.DisplayName = FamName Then
		
		oChosenFamily = oFam
		
		For Each oRow In oFam.TableRows
			
			Val1 = oRow.GetCellValue(sCol1)
			
			If Not List1.Contains(Val1) Then
				List1.Add(Val1)
			End If 
			
		Next
		
	End If
	
Next

Val1 = InputListBox("Select " & sCol1, List1, "", "Content Center Part - " & FamName)

If Val1 = "" Then Return
MessageBox.Show(Val1, "Title")

For Each oRow In oChosenFamily.TableRows
	
	If oRow.GetCellValue(sCol1) = Val1 Then
			thick = oRow.GetCellValue(sCol2) 
			Logger.Info("Index " & oRow.Index)
			Logger.Info(thick)
	End If
	
Next



'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'After Selecting the Nut Size I would like to be able to return the Thickness of that size Nut. This is referenced by the "KOH" parameter 

If Material = "Black (Plain)" Or Material = "Zinc Plated" Then
	Dim Nut = Components.AddContentCenterPart("Nut",
    	                                      "Fasteners:Nuts:" & NutChild,
        	                                  NutTypeName,
            	                              {"Grade", "PC10", "Finish", Material, "SIZE_SEL", BoltSize})
Else
	Dim Nut = Components.AddContentCenterPart("Nut",
    	                                      "Fasteners:Nuts:" & NutChild,
        	                                  NutTypeName,
            	                              {"Grade", Material, "SIZE_SEL", BoltSize })
End If

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 10 of 11

donald_leigh
Enthusiast
Enthusiast

Thanks Heaps @A.Acheson.

 

Where are you located?

 

Donald

0 Likes
Message 11 of 11

A.Acheson
Mentor
Mentor

No problem at all, I'm located in Vancouver. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes