Hi @GosponZ. I am having a difficult time understanding all the details about what you want to happen, and when, versus what is happening now, and when. There may be something lost in translation or something. The only thing I have to go by is the code within the text file I attached to Message 8 above, so if you have changed the code since then, can you please post the code you have now, so we can see it in its current state?
One thing that seemed awkward to me within your earlier code examples was using a multi-value UserParameter for the names of the possible PartsListStyles. This means that this specifically named UserParameter would need to not only exist within every drawing you want to use this code on, but it would also have to have all those same values available, and there would also need to be all of those PartsListStyle objects, as local copies, within each of those drawing files. That seems like a lot of preparation work, and seems like it may be possible for all of that to not be in place properly in every drawing you try this code on. As of the last code example I posted, if the multi-value parameter is not found, it will throw an error, then exit the rule. However, if it was found, but had no values in it, that would just exit the rule, without any error message or warning. And, if no value was chosen from the InputListBox, it would just exit the rule, without any message or warning. And, if a local copy of a PartsListStyle by that name was not found within that drawing, I am not sure if that would throw an error, but it should. I know it was designed to throw an error if there is a problem while trying to add a new PartsList to the sheet, due to the Try...Catch...End Try block, and the message on the Catch side. Just so you are aware, it is not enough to just have those styles available within the main styles library, their must also be a local copy of the style saved within the document, before anything in the document can use the style. If that is not the case within all of the drawings that you will be running this rule on, then you may need to add some code into this rule to create the needed local copies of those styles into the drawing before attempting to apply one of those styles to the PartsList.
Wait...I do think I see something wrong now. Within the 'AddPartsList' Function, after the PartsList is added, there is no line of code present to set the PartsList.Style property to the PartsListStyle it just obtained a few lines of code earlier. It is just setting the PartsList.Position property value, then returning that new PartsList to the 'calling' routine.
Add:
oPList.Style = oPListStye
...in there, just before this:
oPList.Position = oPoint
Wesley Crihfield
(Not an Autodesk Employee)