How does i-logic control custom properties of ipt placed in idw?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
How does i-logic control custom properties of ipt placed in idw?
The standard view of part A was placed in idw.
At this time, I would like to create an item called A-1 in the Custom Properties of Part A and enter the user input value there.
' Get the current IDW document.
Dim idwDoc As DrawingDocument
idwDoc = ThisDoc.Document
' Collect IPT files placed in the IDW.
Dim iptFiles As New List(Of Document)
For Each view As DrawingView In idwDoc.ActiveSheet.DrawingViews
If view.ReferencedDocumentDescriptor.ReferencedDocumentType = DocumentTypeEnum.kPartDocumentObject Then
iptFiles.Add(view.ReferencedDocumentDescriptor.ReferencedDocument)
End If
Next
' Perform the operation for each IPT file.
For Each iptFile As Document In iptFiles
' Prompt the user to input the value for the "Size" property.
Dim specValue As String
specValue = InputBox("Enter specification for " & iptFile.DisplayName & ":", "Specification Input")
' Update or add the "Size" property in the "Design Tracking Properties" of the IPT file.
Dim customProps As PropertySet = iptFile.PropertySets.Item("Design Tracking Properties")
Dim specProp As Inventor.Property
Try
specProp = customProps.Item("Size")
' Update the value if the property exists.
specProp.Value = specValue
Catch
' Add a new property if it doesn't exist.
specProp = customProps.Add(specValue, "Size")
End Try
Next