Macro to remove all custom properties

Hi all

 

Would you know how to remove all custom properties from a SolidWorks document using a macro?

The goal is to integrate it into a smartproperty?

 

Thank you in advance for your answers

Hello

 

Are you already familiar with SolidWorks macros in VBA?

 

The statement is "deleteCustomInfo2" and you have to loop over all the properties of the 3D.

 

For I = LBound(AllProps) To UBound(AllProps)
    If AllProps(I).pSelected Then
        BuBye = Target.DeleteCustomInfo2(AllProps(I).pConfig, AllProps(I).pName)
    End If
Next

 

A link talks about it here:

https://login.solidworks.com/nidp/saml2/sso

 

Or there are two macros to download here (not tested):

http://www.dab-lab.co.uk/how-to-delete-solidworks-custom-properties.html

http://www.esoxrepublic.com/freeware/DeleteCustInfoDownload.php

 

Be careful when launching external macros, it is better to look at the code before launching it!

 

But I don't really understand "the goal being to integrate it into SmartProperties": at the launch of SmartProperties we would have to delete all the already existing properties?

If that's the case, the macro would have to launch only once!

One solution would be to create an additional property, such as Fichier_nettoye to set to 1 with this macro to make sure you don't delete the new properties!

In the smarproperties menu, you have a button that deletes all properties (see diagram)


smarproperties_supprimer.jpg
3 Likes

Hello

 

Do you have the whole suite of MyCadTools tools or just SmartProperties?

If you have everything with the Integration utility you will be able to do what you want automatically on x files.

 

@+

 


integration.jpg
3 Likes

Thank you flegendre, exactly what I wanted to do, but I hadn't seen it.

 

Why is Ducros going crazy?

 

Thanks again