AddVbFile "ContentCenterReplace.txt" Dim replacer As New ContentCenterReplace(ThisDoc.Document, ThisApplication, "en-US") replacer.CreationMode = FileCreationMode.AsStandard 'replacer.CreationMode = FileCreationMode.AsCustom 'replacer.CreationMode = FileCreationMode.ByFunctionName ' this is the default. 'Dim BarLength As Double=200 'Dim PfamilyName As String = "Structural Shapes:Square/Rectangular/Hex Bars:ISO 1035/3 - 1980" 'Dim standardPartName As String = "ISO 1035/3 - 60 x 10 - 0.001" 'Dim customPartName As String = "ISO 1035/3 - 1980 60 x 10 - " & BarLength Dim PipeLength As Double=200 Dim PfamilyName As String = "Tube & Pipe:Conduits:Pipes:ASTM A 53/A 53M Pipe" Dim standardPartName As String = "ASTM A 53/A 53M Pipe 1/8 - Schedule 40 - 10" Dim customPartName As String = "ASTM A 53_A 53M Pipe 1_8 - Schedule 40 - " & PipeLength Dim oDoc As AssemblyDocument = ThisDoc.Document Dim oCompDef As AssemblyComponentDefinition = oDoc.ComponentDefinition Dim oTG As TransientGeometry = ThisApplication.TransientGeometry Dim oMatrix As Matrix = oTG.CreateMatrix oMatrix.SetTranslation(oTG.CreateVector(3, 2, 1)) 'Dim newFileName As String = replacer.GetCustomPartFullFileName(PfamilyName, standardPartName, customPartName, "B_L", BarLength) Dim newFileName As String = replacer.GetCustomPartFullFileName(PfamilyName, standardPartName, customPartName, "PL", PipeLength) Dim oOcc As ComponentOccurrence oOcc = oCompDef.Occurrences.Add(newFileName, oMatrix)