04-19-2021
02:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
04-19-2021
02:09 PM
So here's what I have...I trigger on New and Open.
Dim iProp As Inventor.Property For Each iProp In ThisDoc.Document.PropertySets("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}") If iProp.Name = "Form Factor" Then Exit For Next If iProp Is Nothing Then iProperties.Value("Custom", "Form Factor") = "" End If If iProperties.Value("Custom", "Form Factor") = "" Then Dim FormFactor As String = MessageBox.Show("Is this part a round Part?", "Round Stock Info", MessageBoxButtons.YesNo) If FormFactor = vbYes Then iProperties.Value("Custom", "Form Factor") ="ROUND" Else iProperties.Value("Custom", "Form Factor") ="SQUARE" End If End If
So, from what I can tell, it's not creating the iProperty "fast enough" or there needs to be an updated before I run the second part of the code. The second part works well (tested), when parts do have the iProperty present.