06-12-2023
08:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
06-12-2023
08:21 AM
The code from @clutsa works but if you have a big partslist it can take a while.
I've tried with my code below, which works a bit faster (as it goes through each line of the partslist only once).
Dim app As Inventor.Application = ThisApplication
Dim doc As DrawingDocument = app.ActiveDocument
Dim oSheet As Sheet = doc.ActiveSheet
Dim oPartsList As PartsList = oSheet.PartsLists(1)
Dim oRow As PartsListRow
Dim i As Integer
Do Until i = oPartsList.PartsListRows.Count + 1
On Error Resume Next
oPartsList.PartsListRows(i).Expanded = True
i = i + 1
Loop
However, it still doesn't work fast enough.
I have a partslist with 470 rows and my code takes about 1min15s to execute.
If I would do it manually (open partslist -> select column +/- -> right click -> Expand All Children) it takes only 5-10s.
Is there a way to improve speed of this?
I've also tried with Defer Updates and turn off visibility of Inventor but those didn't help.
Thanks in advance,
Dominiek