Hi @ober2558. This is just a rough draft, since I literally do not know anything about which property it is, or where to put it, or what assembly to get it from. I just assumed you have a drawing open, and have a view of an assembly on that active sheet, and want the first custom iProperty from that assembly. Then I just assumed placing a regular text note somewhere near the lower left corner of the sheet with that property's value would be OK. Here is the code.
Sub Main
If ThisDoc.Document.DocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then
MsgBox("A Drawing document must be active for this code to work. Exiting.", vbCritical, "")
Exit Sub
End If
Dim oDDoc As DrawingDocument = ThisDoc.Document
Dim oSheet As Inventor.Sheet = oDDoc.ActiveSheet
If oSheet.DrawingViews.Count = 0 Then
MsgBox("There are no views on this sheet. Exiting Rule.", , "iLogic")
Exit Sub
End If
Dim oView As DrawingView = oSheet.DrawingViews.Item(1)
If oView.ReferencedDocumentDescriptor.ReferencedDocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then
MsgBox("The first view on this sheet is not of an assembly. Exiting Rule.", , "iLogic")
Exit Sub
End If
Dim oADoc As AssemblyDocument = oView.ReferencedDocumentDescriptor.ReferencedDocument
Dim oCProps As Inventor.PropertySet = oADoc.PropertySets.Item(4) 'the 'Custom' property set
If oCProps.Count = 0 Then
MsgBox("There are no custom iProperties directly in the assembly. Exiting Rule.", , "iLogic")
Exit Sub
End If
Dim oCProp As Inventor.Property = oCProps.Item(1) '<<<Which One ?>>>
Dim oGenNotes As Inventor.GeneralNotes = oSheet.DrawingNotes.GeneralNotes
Dim oPosition As Point2d = ThisApplication.TransientGeometry.CreatePoint2d(1, 1)
Dim sFText As String = oCProp.Value.ToString
Dim oGenNote As GeneralNote = oGenNotes.AddFitted(oPosition, sFText)
End Sub
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield

(Not an Autodesk Employee)