One method sticking with the ilogic snippet is to just drive the designation column or indeed the member column. You can do this using the findrow function

The find row function will actually find the row from the cell value without the column name but then the user doesn't know what is being searched for. You can leave the occurrence name blank to use the default name.
Member Column:
Dim sMember As String
sMember = InputBox("Enter Member Name", "Member Name", "Sockolet_Reducing_CL3000-11")
Dim Sockolet_Reducing_CLPos = ThisAssembly.Geometry.Point(-36.710359, -13.762623, 3.279589)
Dim Sockolet_Reducing_CL = Components.AddContentCenterPart("",
"Tube & Pipe:Fittings:Branches",
"Sockolet Reducing CL3000",
{"Member",sMember },
Sockolet_Reducing_CLPos)Designation Column:
Dim sDesignation As String
sDesignation = InputBox("Enter Designation number", "Designation#", "6-3")
Dim Sockolet_Reducing_CLPos = ThisAssembly.Geometry.Point(-36.710359, -13.762623, 3.279589)
Dim Sockolet_Reducing_CL = Components.AddContentCenterPart("Sockolet Reducing CL3000 6-3:1",
"Tube & Pipe:Fittings:Branches",
"Sockolet Reducing CL3000",
{"DESIGNATION",sDesignation},
Sockolet_Reducing_CLPos)If you want to use the row number you will need to delve into the API a little deeper but you can also do a little more regarding replacing etc. This rule is the reworked API sample.
Sub Main
Dim RowNo As Integer
RowNo= InputBox("Enter member row number", "Member#", 1)
ReplaceContentCenterPart(RowNo,"Tube & Pipe","Fittings","Branches","Sockolet Reducing CL3000")
End Sub
Sub ReplaceContentCenterPart(RowNo As Integer, Fold1 As String, Fold2 As String, _
Fold3 As String, sFamDisName As String)
' a reference to the active assembly document.
Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument
' Prompt user to pick an occurrence
Dim oOcc As ComponentOccurrence
oOcc = ThisApplication.CommandManager.Pick(kAssemblyOccurrenceFilter, "Pick occurrence to replace")
If oOcc.DefinitionDocumentType <> kPartDocumentObject Then
MsgBox ("Occurrence does not reference a content part.")
Exit Sub
End If
Dim oOccDef As PartComponentDefinition
oOccDef = oOcc.Definition
If Not oOccDef.IsContentMember Then
MsgBox ("The occurrence does not reference a content part.")
Exit Sub
End If
' a reference to the ContentCenter object.
Dim oContentCenter As ContentCenter
oContentCenter = ThisApplication.ContentCenter
' Get the content node (category) e.g "Fasteners:Bolts:Hex Head"
Dim oContentNode As ContentTreeViewNode
oContentNode = oContentCenter.TreeViewTopNode.ChildNodes.Item(Fold1).ChildNodes.Item(Fold2).ChildNodes.Item(Fold3)
' Get the family object. e.g "ISO 4015"
Dim oFamily As ContentFamily
For Each oFamily In oContentNode.Families
If oFamily.DisplayName = sFamDisName Then
Exit For
End If
Next
' Create a member based on the second row of the family.
Dim sError As MemberManagerErrorsEnum
Dim strContentPartFileName As String
Dim strErrorMessage As String
strContentPartFileName = oFamily.CreateMember(RowNo, sError, strErrorMessage)
Call oOcc.Replace(strContentPartFileName, False)
End Sub
If this solved a problem, please click (accept) as solution.
Or if this helped you, please, click (like)
Regards
Alan