10-07-2023
02:39 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
10-07-2023
02:39 PM
try this:
Dim doc = ThisApplication.ActiveDocument
Dim sheet As Sheet = doc.ActiveSheet
Dim baseView As DrawingView = sheet.DrawingViews.Item(1)
Dim refDoc As Document = baseView.ReferencedDocumentDescriptor.ReferencedDocument
Dim border = sheet.Border
Dim placementPoint = border.RangeBox.MaxPoint
If border Is Nothing Then
placementPoint = ThisApplication.TransientGeometry.CreatePoint2d(sheet.Width - 2.54 / 2, sheet.Height - 2.54)
End If
Dim partsList As PartsList
Try
partsList = sheet.PartsLists(1)
Catch
partsList = sheet.PartsLists.Add(baseView, placementPoint)
End Try
If refDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
partsList.Style = doc.StylesManager.PartsListStyles.Item("Assembly List")
ElseIf refDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
partsList.Style = doc.StylesManager.PartsListStyles.Item("Parts List Dimensionless")
End If
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com