Is there a way to clear all the "configuration-specific" properties of a batch of parts, to the mayen of a SW tool, Mycad, or a macro? Or will it only highlight the fact that there are one or more "configuration-specific" properties?
It's really annoying to have a bubble in a master plan that comes to look for these properties when we have filled everything cleanly with smartbom or batchproperties >:(
With batchProperties, put the name of the property (1) or properties to be erased with @Delete (2) as the value, then in the options (3) in the applications of the properties, choose on all configurations, and then apply to the batch of parts or assemblies.
I opted for the macro version of yannick.petit, so that I could use it in Mycad integration. The other advantage is that I don't have to specify the name of the properties to be deleted.
I changed the code slightly to remove the manual confirmation request.
Ideally I would have to modify it again so that it acts on all configurations, and not just the active one.
Option Explicit
Sub main()
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swConfig As SldWorks.Configuration
Dim swCustPropMgr As SldWorks.CustomPropertyManager
Dim vPropNames As Variant
Dim vPropName As Variant
Dim configNames As Variant
Dim configName As Variant
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
configNames = swModel.GetConfigurationNames
For Each configName In configNames
Set swConfig = swModel.GetConfigurationByName(configName)
Set swCustPropMgr = swConfig.CustomPropertyManager
vPropNames = swCustPropMgr.GetNames
For Each vPropName In vPropNames
swCustPropMgr.Delete vPropName
Next
Next
End Sub
It's true that batch has the advantage of being almost instantaneous.
I also return the macro because it's not uncommon for me to put my assembly through the mill anyway. Integrating this function in addition is not expensive.