' Get the active assembly. Dim oAsmDoc As AssemblyDocument oAsmDoc = ThisApplication.ActiveDocument ' Get the assembly component definition. Dim oAsmDef As AssemblyComponentDefinition oAsmDef = oAsmDoc.ComponentDefinition ' Get all of the leaf occurrences of the assembly. Dim oLeafOccs As ComponentOccurrencesEnumerator oLeafOccs = oAsmDef.Occurrences.AllLeafOccurrences ' Iterate through the occurrences and print the name. Dim cnt As Integer cnt = 0 Dim total As Double Dim oOcc As ComponentOccurrence For Each oOcc In oLeafOccs If oOcc.DefinitionDocumentType = kPartDocumentObject Then Dim oReferDoc As PartDocument oReferDoc = oOcc.ReferencedDocumentDescriptor.ReferencedDocument Dim oProp As Inventor.Property For Each oProp In oReferDoc.PropertySets.Item(4) If oProp.DisplayName.Contains("CUTDETAIL") = True Then Dim oName As String oName = oProp.Name Dim sawAngle As String sawAngle = oProp.Value Dim angle(1) As String angle = sawAngle.Split(" ") Select Case angle(0) Case "Cut" If angle(2) <> 90 Then needAngle = 90 - Convert.ToDouble(angle(2)) oReferDoc.PropertySets.Item(4).Item(oName).Value = "Cut Angle " + needAngle.ToString + " deg" End If Case "Miter" If angle(1) <> 90 Then needAngle = 90 - Convert.ToDouble(angle(1)) oReferDoc.PropertySets.Item(4).Item(oName).Value = "Miter " + needAngle.ToString + " deg" End If End Select End If Next End If Next