Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Hi @bradeneuropeArthur.  I don't recall if I have tried doing that by code before, but I think it might be possible, with a lot of digging.  I believe you have to climb the 'Parent' ladder up to the assembly BOM object itself, then I would think that you could change the value of its StructuredViewFirstLevelOnly property, if your PartsList was based on the Structured BOMView.  I highly doubt you would be able to switch from Structured to Parts Only, or something like that though, without having to delete it then recreate it specifying that other 'Level'.

 

To get from the PartsList object to the assembly BOM, you could have to start from a PartsListRow object.  Then use its ReferencedRows property (returns ObjectsEnumerator) to get a reference to the DrawingBOMRow object that it represents (Item(1) in the ReferencedRows).  The DrawingBOM also has the 'Level' property, but it is still ReadOnly, so we have to go further up.  Then use the DrawingBOMRow.BOMRow property to a reference to that BOMRow object.  Then use its Parent property would get us a reference to the BOMView object.  You may or may not need to check its BOMView.ViewType to see which type you are dealing with at this point, but you can not change its level from there.  Then use the BOMRow.Parent property to finally get the BOM object.  Then, as mentioned before, if its referencing the Structured view, you may be able to switch its level by changing the value of the BOM.StructuredViewFirstLevelOnly property.  Just a thought path for now.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)