08-26-2020
12:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-26-2020
12:31 AM
You must use a value of the datatype expected by the property type you want it to be.
For example, if you want a date property, the value must be of a date type.
Dim propertyName1 As String = "Rev Desc" Dim propertyValue1 As String = "" Dim customPropertySet As PropertySet = ThisDoc.Document.PropertySets.Item("Inventor User Defined Properties") Try prop = customPropertySet.Item(propertyName1) Catch customPropertySet.Add("", propertyName1) End Try Dim propertyName2 As String = "Rev Date" Dim propertyValue2 As Date = Today.Date Try prop = customPropertySet.Item(propertyName2) Catch customPropertySet.Add(propertyValue2, propertyName2) End Try Dim propertyName3 As String = "Salvagnini Proficient" Dim propertyValue3 As Boolean = True Try prop = customPropertySet.Item(propertyName3) Catch customPropertySet.Add(propertyValue3, propertyName3) End Try
Jhoel Forshav
Download my free Inventor Addin - Hole Projector
LinkedIn | Ideas | Contributions | Blog posts | Website