Config-specific properties

Hello

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  >:(

1 Like

Hello.

You can try Batch Custom Properties Program

Go to the options to view the properties of the Configs 

Hello

This link should help you

https://bluebyte.biz/macros/delete-all-properties-for-the-active-configuration-solidworks-macro/

 

Kind regards 

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.

1 Like

Thank you for your answers

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.

To delete on each config:

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

 

1 Like

Hello

Otherwise in BatchProperties if you put * in the name of the property it deletes all the properties

This eliminates the need to open files in SOLIDWORKS to launch the macro and saves time.

Have a nice day

Philippe

2 Likes

Nickel

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.

Many thanks!