Assembly create Part List

Hello and best wishes for 2021!

I’m trying to pull a part list from an assembly, using:

views = []
view_orientation = AssemblyDetailViewOrientation.DetailSectionB

view_created = AssemblyViewUtils.CreateDetailSection(doc, assembly.Id, view_orientation)
view_created.Name = 'Part List'
views.append(view_created)
TransactionManager.Instance.TransactionTaskDone()

This works fine, but I want to create a part list as a schedule for each assembly.
image

The API only gives sections and elevations, but not the other options ;( Note that I dont want the information of the part list, but really want to make the schedule itself. For those asking, yes, choosing the section/elevations works fine and this will create the view in the assembly properly.

Thanks!

Rick

Never mind, figured it out!

views = []
TransactionManager.Instance.EnsureInTransaction(doc)

view_created = AssemblyViewUtils.CreatePartList(doc, assembly.Id)
view_created.Name = 'Part List'
views.append(view_created)
TransactionManager.Instance.TransactionTaskDone()