05-01-2024
09:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
05-01-2024
09:31 AM
' Get the current drawing document Dim doc As DrawingDocument = ThisDoc.Document ' Loop through all the sheets in the drawing For Each sheet As Sheet In doc.Sheets ' Get the first view on the sheet Dim view As DrawingView = Sheet.DrawingViews.Item(1) ' Check if the view exists If Not view Is Nothing Then ' Print the name of the sheet being checked Debug.Print("Checking sheet: " & Sheet.Name) ' Get the associated model Dim model As Document = view.ReferencedDocumentDescriptor.ReferencedDocument ' Check if the model exists and has the desired iProperty If Not model Is Nothing Then Try ' Get the value of the desired iProperty (replace "CustomProperty" with your actual iProperty name) Dim customPropertyValue As String = model.PropertySets.Item("Inventor Summary Information").Item("Panel ID").Value ' Output the value of the iProperty MsgBox("The value of the custom property is: " & customPropertyValue & vbCrLf & "Checked on sheet: " & Sheet.Name) Catch ex As Exception ' Handle the case where the property doesn't exist ' You can add your custom error handling here MsgBox("The desired iProperty does not exist in the model.") End Try End If End If Next