04-20-2021
05:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
04-20-2021
05:24 AM
I even threw a pause in there..thinking it was running into the next instruction before the iProperty could be created....and even at 1 second (a billion years in computer time), I still get the same error.
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") = "" ThisDoc.Document.PropertySets("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}").Add("","Form Factor") End If System.Threading.Thread.CurrentThread.Sleep(1000) 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