Hi @mtoddHBKNF. Not sure which way you wanted to go with this iLogic rule, so I am showing both ways I had in mind. Central section is commented out, and was for letting a user choose one of the names from a list, then applying that style to all PartsLists on the active sheet. The last portion, which is not commented out, is for setting that list of names as the multi-value list of a text type user parameter in the drawing. I hope one of those is what you were looking for. It still does not check sheet size, then apply one automatically, just based on that size, but one step at a time, right.
Sub Main
Dim oInvApp As Inventor.Application = ThisApplication
Dim oDDoc As DrawingDocument = TryCast(ThisDoc.Document, Inventor.DrawingDocument)
If oDDoc Is Nothing Then Return
Dim oPListStyles As PartsListStylesEnumerator = oDDoc.StylesManager.PartsListStyles
Dim oPLSNames As New List(Of String)
For Each oPLS As PartsListStyle In oPListStyles
oPLSNames.Add(oPLS.Name)
Next
'<<< section for applying chosen style to all PartsLists on active sheet >>>
' Dim sPrompt As String = "Select a PartsListStyle to use."
' Dim sTitle As String = "PartsList Styles"
' Dim sListName As String = "PartsList Styles List"
' Dim sChosenPLSName As String = InputListBox(sPrompt, oPLSNames, oPLSNames.Item(0), sTitle, sListName)
' If sChosenPLSName Is Nothing OrElse sChosenPLSName = "" Then Return
' Dim oChosenPLS As PartsListStyle = oPListStyles.Item(sChosenPLSName)
' For Each oPList As PartsList In oDDoc.ActiveSheet.PartsLists
' oPList.Style = oChosenPLS
' Next
'<<< end of that section >>>
'<<< set list of names as multi-value text type user parameter >>>
Dim oUParams As UserParameters = oDDoc.Parameters.UserParameters
Dim oUParam As UserParameter = Nothing
Dim sParamName As String = "PartsListStyleNamesList"
Try
oUParam = oUParams.Item(sParamName)
Catch
oUParam = oUParams.AddByValue(sParamName, "", UnitsTypeEnum.kTextUnits)
'may need to add extra set of double quotes around each entry to get it to work
iLogicVb.Automation.MultiValueSetValueOptions(True)
iLogicVb.Automation.ParamMultiValues(oDDoc, sParamName) = oPLSNames.ToArray()
'oUParam.ExpressionList.SetExpressionList(oPLSNames.ToArray())
End Try
oDDoc.Update2(True)
End Sub
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield

(Not an Autodesk Employee)