Issue
In the Format Text dialog you can select the Properties of the Model. I need to find out programmatically which referenced document these iProperties are coming from. I tried using the last ReferencedDocument of the drawing but this is not always the right document. Is there a way to determine the document providing these properties for the text?
Solution
The document that supplies the iProperties in the Format Text dialog is the document that is referenced by the first view on the sheet. Here is an example that shows how to get this document using the views ReferencedDocumentDescriptor:
In VB.Net
Sub test()
If m_inventorApp.ActiveDocument.DocumentType <>
DocumentTypeEnum.kDrawingDocumentObject Then
Exit Sub
End If
Dim oDrawDoc As DrawingDocument =
m_inventorApp.ActiveDocument
Dim oView As DrawingView
oView = oDrawDoc.ActiveSheet.DrawingViews(1)
Dim oRefDocDesc2 As DocumentDescriptor =
oView.ReferencedDocumentDescriptor
System.Diagnostics.Debug.Write(oRefDocDesc2.FullDocumentName)
End Sub