It seems the contribution post I mentioned above has been discontinued. Here is the information contained in that post. Note rule 1 below will extract the style names from styles xml file.
Import Parameters to Route Workflow:
When using the Add-in Tube and Pipe, parameters can be difficult to utilize within the route. It can be very time-consuming to search for and load the parameters associated with the piping diameter and style. Run and Route templates are not available to store parameters unlike part and assembly templates. In order to use standardized parameters for each pipe style, it is necessary to import parameters into each route when required. This is a manual process as shown in the below image.

The four external rules below are a workflow to automate this process. Rules 1-2 prepare the part file for parameter creation; the user then creates the necessary parameters before using rule 3 to export parameters to an xml file. Rule 4 is the main rule to detect the active route style and load the parameters associated to this style.
To ensure filenames have no illegal characters that would prevent a file save and to improve consistency, a function is used in Rules 2&4. Please ensure any changes made to the functions are mirrored in each rule.
1. T&P Extract Style Names
Use this rule to extract current style names to an excel sheet in order to standardize naming conventions. Before running this rule, find the tube and pipe styles tab on the ribbon and access the dialogue box. Select styles by category for example category (Rigid Pipe With Fittings) see image, right click and manually export and save to "C:\Temp\Tube and Pipe Styles.xml." Adjust this file path as required and change in the code below.
AddReference "Microsoft.Office.Interop.Excel.dll" 'To use excel
Imports Xl = Microsoft.Office.Interop.Excel 'To use excel
Sub Main
'Specify the XML path and filename
Dim XMLFile As String = InputBox("Prompt", "Styles Path XML File", "C:\Temp\Tube and Pipe Styles.xml")
'Specify the excel path and filename
Dim XLFile As String = InputBox("Prompt", "Styles excel file", "C:\Temp\Tube and Pipe Styles.xlsx")
'Start a new instance of Excel, make visible and disable alerts.
Dim excelApp As Object = CreateObject("Excel.Application")'XL.Application
Dim xlwb As XL.Workbook
Dim xlws As XL.Worksheet
excelApp.Visible = True
excelApp.DisplayAlerts = False
'Open Excel worksheet and import xml information.
Try
xlwb = excelApp.Workbooks.OpenXML(Filename :=XMLFile,LoadOption :=xlXmlLoadImportToList)
Catch
MessageBox.Show("Cannot find XML File: Exiting", "iLogic")
Exit Sub
End Try
'Specify the excel sheet.
xlws = xlwb.Worksheets(1)
xlws.Activate
'Format height of sheet rows.
xlws.Rows("1:500").RowHeight = 15
'Save the workbook.
xlwb._SaveAs(XLFile)
excelApp.DisplayAlerts = True
'Close the Workbook.
'xlwb.Close
End Sub
2. T&P Create Route Parameter Part File
Rule modified from Source and uses function to remove illegal characters.
Sub Main
'Open the excel worksheet containing the style names, modify path as needed .
Dim XLFile As String = InputBox("Prompt", "Styles excel file", "C:\Temp\Tube and Pipe Styles.xlsx")
GoExcel.Open(XLFile, "Sheet1")
'Set the list of Style Names reading from the excel worksheet.
Dim StyleList As New List (Of String)
Dim i As Integer = GoExcel.FindRowStart
'Define the number of rows we want to search in
Do Until i = 100 + GoExcel.FindRowStart ' 100 rows plus the start row position'
'Add name to list excluding blank cells
If GoExcel.CellValue(XLFile, "Sheet1", "A" & i) = ""
Exit Do
End If
StyleList.Add(GoExcel.CellValue(XLFile, "Sheet1", "A" & i))
i = i + 1
Loop
'Present the list to the user
Dim StyleName As String = InputListBox("Select a name", StyleList, "", "iLogic", "Available Style Names")
'MessageBox.Show(StyleName, "iLogic")
'Filename creation,replacement string for fileName ilegal Characters.
Dim replace_with As String = ""
'Function to remove ilegal characters from Style Name before saving file
Dim oFileName As String = clean_filename(StyleName, replace_with)
'MessageBox.Show(oFileName, "iLogic")
'Option to use exisitng part and save as or create a new one
Question = InputRadioBox("Pick One", "Existing File Save As New Name", "Create New Part File", True, Title := "File Source")
Dim oPartDoc As PartDocument
Dim oFilePath As String
If Question = True
' Create a new part file
oPartDoc = ThisDoc.Document
oFilePath = ThisDoc.Path & "\"
Else
'note: kPartDocumentObject is the default template,specify template file to use
oPartDoc = ThisApplication.Documents.Add(kPartDocumentObject, , True)'"C:\Temp\Standard.ipt" Modify file as needed.
oFilePath = "C:\Temp\"
End If
Dim oPartFile As String = oFilePath & oFileName & ".ipt"
'Check for existing file
If System.IO.File.Exists(oPartFile) Then
'Present option for Filecheck to avoid overwriting file accidentally
FileCheck = InputRadioBox("Pick One", "Overwite Existing File", "Exit without Save", True, Title := "Part File Allready Exists")
If FileCheck = True
Try
'Overwrite the file if it exist
oPartDoc.SaveAs(oPartFile, False)
Catch
MessageBox.Show("Part File save problem,Using Save As on a file of the same name", "iLogic")
End Try
Else
Exit Sub
End If
'Save the file if it does not exist
ElseIf Not System.IO.File.Exists(oPartFile) Then
oPartDoc.SaveAs(oPartFile, False)
End If
End Sub
Function clean_filename(StyleName As String, replace_with As String)
Dim inv_chars As String
Dim cpos As Long
'Origional List adjust function contents in invchars as needed.
'"'!""#¤%&/()=?`^*>;:@£${[]}|~\,.'¨´+-"
invchars = "'!""#¤%&/=?`^*>;:@£${[]}|~\,.'¨´+"
For cpos = 1 To Len(invchars)
StyleName = Replace(StyleName, Mid(invchars, cpos, 1), replace_with)
Next
clean_filename = StyleName
End Function
3. T&P Export Route Parameters
'Get active Directory
Dim oDirectory As String = "C:\Temp\"
'Get active filename
Dim oName As String = ThisDoc.FileName(False) 'without extension
'Set new name for xml file
Dim oXMLFile As String = oDirectory & oName & ".xml"
'MessageBox.Show(oXMLFile, "iLogic")
'Check for existing file
If System.IO.File.Exists(oXMLFile) Then
'Present option for Filecheck to avoid overwriting file accidentally.
Dim FileCheck As Boolean = InputRadioBox("Pick One", "Overwite Existing File", "Exit without Save", True, Title := "File Allready Exists")
If FileCheck = True
Try
'Overwrite the file if it exist.
iLogicVb.Automation.ParametersXmlSave(ThisDoc.Document, oXMLFile)
Catch
MessageBox.Show("File save problem", "iLogic")
End Try
Else
Return
End If
'Save the file if it does not exist.
ElseIf Not System.IO.File.Exists(oXMLFile) Then
iLogicVb.Automation.ParametersXmlSave(ThisDoc.Document, oXMLFile)
End If
MessageBox.Show("Parameters exported", "iLogic")
4. T&P Import Route Parameters
Sub Main
Dim oDoc As Document = ThisDoc.Document
Dim oCDs As ControlDefinitions = ThisApplication.CommandManager.ControlDefinitions
'Active Style (Combo Box Tube and Pipe Styles)
Dim oCD As ControlDefinition= oCDs("HSL:Piping:StylesComboBox")
'Get active style name.
Dim StyleName As String = oCD.ToolTipText
'MessageBox.Show(StyleName, "iLogic")
'File Name Creation Replacement String for FileName ilegal Characters.
Dim replace_with As String = ""
'Function to remove ilegal characters from filename if present, adjust function contents as needed.
Dim oFileName As String = clean_filename(StyleName, replace_with)
'MessageBox.Show(sNewName, "iLogic")
'Import XML
If oFileName = "" Then : Return : End If
'File directory where xml file is stored.
Dim FilePath As String = "C:\Temp\"
'Set new name for xml file.
Dim oXMLFile As String = FilePath & oFileName & ".xml"
'Open the selected file.
iLogicVb.Automation.ParametersXmlLoad(oDoc,oXMLFile)
'Update the file.
iLogicVb.UpdateWhenDone = True
MessageBox.Show("Parameter Import Complete", "iLogic")
End Sub
Function clean_filename(StyleName As String, replace_with As String)
Dim inv_chars As String
Dim cpos As Long
'Origional List adjust function contents in invchars as needed.
'"'!""#¤%&/()=?`^*>;:@£${[]}|~\,.'¨´+-"
invchars = "'!""#¤%&/=?`^*>;:@£${[]}|~\,.'¨´+"
For cpos = 1 To Len(invchars)
StyleName = Replace(StyleName, Mid(invchars, cpos, 1), replace_with)
Next
clean_filename = StyleName
End Function
If this solved a problem, please click (accept) as solution.
Or if this helped you, please, click (like)
Regards
Alan