That command is not very useful beyond that dialog launch by code as it doesn't have the ability to browse for a family.
There is build in methods for adding content center parts by ilogic and the API.
Ilogic Add:
This method is by far the easiest for placing from content center. Found in the ilogic editor browser menu. Simply place the family member you need in the assembly and use capture snippet and add. Post here showing how to use this functionality
API Add:
Here is the sample for placing content center part written in VBA. It is a much longer route than using ilogic short snippet.
API Replace:
Replace an existing CC member.
Here is a starting point for you, it will choose the first occurrence in the assembly and select another member of the same family. Original code posted here.
'This iLogic demo replaces the given standard component
'with another member from same family.
' row number of the new family member .
Dim NewRow As Integer = 4
'active assembly s
Dim oMainAsm As AssemblyDocument = ThisDoc.Document
Dim oAsmDef As AssemblyComponentDefinition = oMainAsm.ComponentDefinition
' get the occurrence by its position in the occurrences collection
Dim oOcc As ComponentOccurrence = oAsmDef.Occurrences.Item(1)
Dim oDef As PartComponentDefinition = oOcc.Definition
Dim oDoc As PartDocument = oDef.Document
'reference to the CC properties - oProps
Dim oPropSets As PropertySets = oDoc.PropertySets
Dim oProps As PropertySet = oPropSets.Item("Content Library Component Properties")
' family id
Dim oProp As Inventor.Property = oProps.Item("FamilyId")
Dim FamilyId As String = oProp.Value
'MsgBox("FamilyId: " + FamilyId)
'reference to the ContentFamily
Dim oContentCenter As ContentCenter = ThisApplication.ContentCenter
Dim oFamily As ContentFamily = oContentCenter.GetContentObject("v3#" + FamilyId + "#")
'MsgBox("Content Family DisplayName: " + oFamily.DisplayName & vbNewLine & _
' "Rows in Family: " & oFamily.TableRows.Count )
'create new member file
Dim ErrorType As MemberManagerErrorsEnum
Dim strContentPartFileName As String
Dim strErrorMessage As String
strContentPartFileName = oFamily.CreateMember(NewRow, ErrorType, strErrorMessage)
'replace the existing component with the new one
oOcc.Replace(strContentPartFileName, False)
Beep
'------------------------
If this solved a problem, please click (accept) as solution.
Or if this helped you, please, click (like)
Regards
Alan