Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Here is a quick example, (welcome to the forum, btw)

 

Try
	oFinish = iProperties.Value("Custom", "Finish")
Catch
	'property not found
	Return' exit rule
End Try

Dim oAssyDoc As AssemblyDocument
oAssyDoc = ThisApplication.ActiveDocument
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = oAssyDoc.ComponentDefinition

If oAsmCompDef.Type = ObjectTypeEnum.kWeldmentComponentDefinitionObject Then
	Return 'exit rule
End If

Dim oOcc As ComponentOccurrence
Dim oDoc As Document
For Each oOcc In oAsmCompDef.Occurrences.AllLeafOccurrences
    oDoc = oOcc.Definition.Document
	oPropSet = oDoc.PropertySets.Item("User Defined Properties")
    Try
		oProp = oPropSet.Add("", "Finish")
	Catch
		oProp = oPropSet.Item("Finish")
	End Try
	
	oProp.value = oFinish	
Next