GetRetrievableAnnotations (Inventor 2025)

GetRetrievableAnnotations (Inventor 2025)

jiri.paur
Participant Participant
529 Views
2 Replies
Message 1 of 3

GetRetrievableAnnotations (Inventor 2025)

jiri.paur
Participant
Participant

Hello,

after upgrading to 2025 version, I get a problem with retrieving model dimensions to a drawing.

In earlier versions of the Inventor (2023 and earlier) I used oSheet.DrawingDimensions.GeneralDimensions.GetRetrievableDimensions without any problems and the code returned ObjectCollection with the retrievable dimensions. In 2025 the API changed to oSheet.GetRetrievableAnnotations and the code returns empty collection, while oSheet.RetrieveAnnotations generate dimensions in the view correctly.

Code:

Public Sub test()
    Dim oDrw As DrawingDocument
    Set oDrw = ThisApplication.ActiveDocument
    
    Dim oSheet As Sheet
    Set oSheet = oDrw.ActiveSheet
    
    Dim oView As DrawingView
    Set oView = oSheet.DrawingViews.Item(1)
    
    Debug.Print "GetRetrievableAnnotations:"; oSheet.GetRetrievableAnnotations(oView).Count
    Debug.Print "RetrieveAnnotations:", oSheet.RetrieveAnnotations(oView).Count
End Sub

returns:

GetRetrievableAnnotations: 0 
RetrieveAnnotations:       462 

 

Any idea how to get retrievable dimensions in 2025?

 

best regards

Jiri

0 Likes
530 Views
2 Replies
Replies (2)
Message 2 of 3

jiri.paur
Participant
Participant
I forgot to state that this occurs only if the views are created from an assembly. It works fine for views created from a part.
0 Likes
Message 3 of 3

jiri.paur
Participant
Participant

I find out that if I state component occurrence then the code returns the retrievable dimensions. So probably a loop through all occurrences is the solution in 2025 version

 

Debug.Print "GetRetrievableAnnotations:"; oSheet.GetRetrievableAnnotations(oView, , oAsm.ComponentDefinition.Occurrences.Item(1)).Count

 

 

0 Likes