Here is a method to do it. You can change the criteria of row selection to whatever make sense. For Pipe ND and SN are straight forwarded, basically anything that is a key in your CC dialog.
Dim oDoc As AssemblyDocument = ThisDoc.Document
Dim oDef As AssemblyComponentDefinition = oDoc.ComponentDefinition
Dim oCC As ContentCenter = ThisApplication.ContentCenter
Dim oCCmember As ComponentOccurrence = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyLeafOccurrenceFilter, "Select a component to add to the folder, Press Esc when Complete")
Dim NDList As String() = {"2", "3", "4", "5", "6" }
Dim ND As String = InputListBox("Choose a ND", NDList, "2", Title := "Change Pipe ND", ListName := "PIPE ND")
If ND = Nothing Then Return
Dim PL As String = InputBox("Enter a Length in inches", "PL", "600")
Dim propSet As PropertySet = oCCmember.Definition.Document.PropertySets.Item("{B9600981-DEE8-4547-8D7C-E525B3A1727A}")
'Get FamilyId property.
Dim familyId As Inventor.Property = propSet.Item("FamilyId")
'Get Family.
Dim oContentFamily As ContentFamily = oCC.GetContentObject("v3#" & familyId.Value & "#")
' Get MemberId property
Dim strMemberId As String = propSet("MemberId").Value
'Get Current Row
Dim oCurrentTableRow As ContentTableRow = oCC.GetContentObject("v3#" & familyId.Value & "#" & strMemberId)
'Set the column criteria.
Dim ND_Col As ContentTableColumn = oContentFamily.TableColumns.Item("ND")
Dim Sch_Col As ContentTableColumn = oContentFamily.TableColumns.Item("SN")
'Get current schedule or have seperate list.
Dim CurrentSch As String = oCurrentTableRow.GetCellValue(Sch_Col)
Dim oNewMember As String
'Get Row.
Dim oContentTableRow As ContentTableRow
For Each oContentTableRow In oContentFamily.TableRows
'Set the criteria for row selection
If oContentTableRow.GetCellValue(ND_Col) = ND AndAlso oContentTableRow.GetCellValue(Sch_Col) = CurrentSch
'Logger.Info(oContentTableRow.Index)
Dim ee As MemberManagerErrorsEnum
'PL value.
Dim oNv As NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap
oNv.Add("PL", PL)
'Create Member.
oNewMember = oContentFamily.CreateMember(oContentTableRow, ee, "Some error occured", , False, , oNv)
'Replace member.
oCCmember.Replace(oNewMember, False)
End If
Next
If String.IsNullOrEmpty(oNewMember) Then
MessageBox.Show("No matching row found", "Title")
End If
oDoc.Update
If this solved a problem, please click (accept) as solution.
Or if this helped you, please, click (like)
Regards
Alan