Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I must be missing something completely obvious but I'm having issues placing a parts list. I had some code that I used before that worked perfectly. Now it doesn't seem to work anymore. Here's the simplified code:
' Set a reference to the Drawing Document
Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument
' Set a reference to the Active Sheet
Dim oSheet As Sheet = oDoc.Sheets.Item(1)
' Set a reference to the Drawing Views collection
Dim oDrawingViews As DrawingViews = oSheet.DrawingViews
' Set a reference to the Drawing View
Dim oDrawingView As DrawingView = oDrawingViews.Item(1)
' Set a reference to the sheet's Title Block
Dim oTitleBlock As TitleBlock = oSheet.TitleBlock
' Set the Parts List Position
Dim oTempPartsListPosition As Point2d = oTitleBlock.RangeBox.MaxPoint
' Place the Parts List
Dim oPartsList As PartsList = oSheet.PartsLists.Add(oDrawingView, oTempPartsListPosition)
Then I tried the VBA sample (converted to iLogic), but the error still remains:
' Set a reference to the drawing document.
' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
'Set a reference to the active sheet.
Dim oSheet As Sheet
oSheet = oDrawDoc.ActiveSheet
' Set a reference to the first drawing view on
' the sheet. This assumes the first drawing
' view on the sheet is not a draft view.
Dim oDrawingView As DrawingView
oDrawingView = oSheet.DrawingViews(1)
' Set a reference to th sheet's border
Dim oBorder As Border
oBorder = oSheet.Border
Dim oPlacementPoint As Point2d
If Not oBorder Is Nothing Then
' A border exists. The placement point
' is the top-right corner of the border.
oPlacementPoint = oBorder.RangeBox.MaxPoint
Else
' There is no border. The placement point
' is the top-right corner of the sheet.
oPlacementPoint = ThisApplication.TransientGeometry.CreatePoint2d(oSheet.Width, oSheet.Height)
End If
' Create the parts list.
Dim oPartsList As PartsList
oPartsList = oSheet.PartsLists.Add(oDrawingView, oPlacementPoint)I'm on Inventor 2024.3, the last time I used my original code was on Inventor 2023.3. Does anyone see something wrong with the code or is there some kind of bug?

Solved! Go to Solution.