Sure anything is possible 😉
I suggest you study the code, it's very simplistic.
Public Sub MatCopy()
'JDK 2013
On Error Resume Next
' Get the Assy Document
Dim oAssDoc As AssemblyDocument
Set oAssDoc = ThisApplication.ActiveDocument
' Select occurrence
Dim oOccurrence As ComponentOccurrence
Set oOccurrence = oAssDoc.SelectSet.Item(1)
If Err Then
MsgBox "An occurrence must be selected."
Err.Clear
On Error GoTo 0
Exit Sub
End If
' Define name and material as strings
sName = oOccurrence.name
sMat = oOccurrence.Definition.Material.name
' Get custom property set
Dim customPropSet As PropertySet
Set customPropSet = oAssDoc.PropertySets( _
"Inventor User Defined Properties")
' Add new property with name and material
Call customPropSet.Add(sMat, sName)
' Msg the material
MsgBox (sName & " = " & sMat)
End Sub
Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.