03-01-2021
11:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-01-2021
11:51 AM
@mcgyvr Thanks for your help. This code unfortunately doesn't keep the link to the iProperties when you double click on the view label after running the code. It leaves it as text.
I got someone else to look at this and they gave me some code that I slightly modified and it looks like its working. The only thing that I still need to figure out is how to underline the text at the end?
If ThisApplication.ActiveDocumentType = kDrawingDocumentObject Then Dim oView As DrawingView oView = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select View") MsgBox(oView.Name) oView.ShowLabel = True 'show label for selected view 'Inventor.Document.PropertySets.Item("Design Tracking Properties") 'ThisPartInfo = DrawingView.ScaleString & " SCALE" & vbLf & partName & " Name" & vbLf & DesProperty.Value & " Description" oPartNumber = "<Property Document='model' PropertySet='Design Tracking Properties' Property='Part Number'> PART NUMBER </Property><Br/>" o_iPropID_1 = ThisDoc.ModelDocument.PropertySets.Item("User Defined Properties").Item("Member").PropId oMember = "<Property Document='model' PropertySet='User Defined Properties' " _ & "Property='My_iProp_1' FormatID='{D5CDD505-2E9C-101B-9397-08002B2CF9AE}' PropertyID='" _ & o_iPropID_1 & "'>My_iProp_1</Property><Br/>" o_iPropID_2 = ThisDoc.ModelDocument.PropertySets.Item("User Defined Properties").Item("TotalQty").PropId oTotalQty = "<Property Document='model' PropertySet='User Defined Properties' " _ & "Property='My_iProp_2' FormatID='{D5CDD505-2E9C-101B-9397-08002B2CF9AE}' PropertyID='" _ & o_iPropID_2 & "'>My_iProp_2</Property>" oView.Label.FormattedText = oPartNumber & oMember & oTotalQty & " X OFF " End If