Cut List Item renaming

I'm trying to make a macro that renames cut list folders andsets each PARTNUMBER property to be the same. It works, but forstructural member items it does not update the"LENGTH@@@Cut-List-Item1@.." property so the cut list on the sheethas 0.0 length. Manually renaming the folder by hand automaticallychanges the LENGTH custom property. Manually changing the LENGTHproperty doesn't stick, it goes back to Cut-List-Item1automatically. help!

-Tom

snippet of code:

Sub Main()
Dim swApp As SldWorks.SldWorks
Set swApp = Application.SldWorks
Dim doc As SldWorks.ModelDoc2: Set doc = swApp.ActiveDoc
Dim partdoc As SldWorks.partdoc: Set partdoc = doc
Dim f As Feature: Set f = doc.FirstFeature
Dim n As Integer: n = 0
Dim num As String

Do While Not f Is Nothing
If f.GetTypeName = "CutListFolder"
n = n + 1
If n < 1000 Then
num = "-" + Right(Str\$(n), Len(Str\$(n)) - 1)
End If
If n < 100 Then
num = "-0" + Right(Str\$(n), Len(Str\$(n)) - 1)
End If
If n < 10 Then
num = "-00" + Right(Str\$(n), Len(Str\$(n)) - 1)
End If
If f.CustomPropertyManager.Add("PARTNUMBER", "Text",Left(doc.GetTitle, Len(doc.GetTitle) - 7) + num) Then
End If

f.Name = Left(doc.GetTitle, Len(doc.GetTitle) - 7) + num

End If
Set f = f.GetNextFeature
Loop

End Sub
SolidworksApi macros