Public Sub CreateCustomProperties() ' Get the active document. Dim invDoc As Document Set invDoc = ThisApplication.ActiveDocument ' Get the user defined (custom) property set. Dim invCustomPropertySet As PropertySet Set invCustomPropertySet = invDoc.PropertySets.Item("Inventor User Defined Properties") ' Declare some variables that will contain the various values. Dim strText As String Dim dblValue As Double Dim dtDate As Date Dim blYesOrNo As Boolean ' Set values for the variables. strText = "Some sample text." dblValue = 3.14159 dtDate = Now blYesOrNo = True ' Create the properties. Dim invProperty As Property Set invProperty = invCustomPropertySet.Add(strText, "Test Test") Set invProperty = invCustomPropertySet.Add(dblValue, "Test Value") Set invProperty = invCustomPropertySet.Add(dtDate, "Test Date") Set invProperty = invCustomPropertySet.Add(blYesOrNo, "Test Yes or No") End Sub
inventor宏写入属性
最新推荐文章于 2022-12-10 15:39:53 发布