for your information, cutlist bodies, as well as other solid bodies and surface bodies, are 'named' at the time of creation, which means ,at the time of creation of the feature that created it...
so yes you can rename the bodies anytime after, but you have to do a forcerebuild after.
as for the custom properties already made and/or equations, it's another set of problem...
...i suggest getting the data, such as values or properties names or equations variables, via your macro BEFORE renaming your bodies, then deal the respective changes of names, then delete/create/update them with the new names...
I hope its been somewhat helpful ...
Thank you for the clarification.
I ended up doing as you suggested, get the name of the feature before rename, the search and replace the name.
Currently I only wrote a find and replace for Cutlist properties. However I will need to do it for Custom Properties & equations and hopefully that covers all bases.
Attached is the short hand code for reference. (A bit rough compared to implemented code as I used more Classes)
Public Shared Sub RenameCutlistProperties(ByRef ModDOc As PartDoc, ByVal OldName As String, ByVal NewName As String)
Dim aFeature As IFeature = ModDoc.FirstFeature()
Dim CustPropMgr As ICustomPropertyManager
Do While aFeature IsNot Nothing
If aFeature.GetTypeName2 = "CutListFolder" Then
Dim CutFolder As BodyFolder = aFeature.GetSpecificFeature2
If CutFolder.GetBodyCount > 0 Then
CustPropMgr = aFeature.CustomPropertyManager
Dim ValueOut As String = ""
Dim ResovedValue As String = ""
CustPropMgr.Get2("Description", ValueOut, ResovedValue) 'Do this for all properties.
If ResovedValue IsNot "" AndAlso Not ResovedValue.Contains(OldName) Then
CustPropMgr.set2("Description", ResovedValue.Replace(OldName, NewName))
aFeature = aFeature.GetNextFeature()
If you really are trying to rename first feature then this might be Favourites folder. Anyway, I just had created such macro which renames cutlist folders and bodies and cut list properties are automatically resolved to new names.
This is actually "because I can" project because this feature should come in 2015 beta in summer.
It is even greater joy to be able to modify SolidWorks yourself without needing to wait for new versions.