From: Ronni on
Hey - I am trying to make a macro that can delete all my custum
properties (configuration specifik props) except those in the Default
configuration.

I am trying to do it manually by writing in all the names of the
properties, but that aint really a good solution (I have around 30-50
different named properties and not all are present on all parts)

Also I am trying to just take them from i=1 (instead of i=0, then
presuming that default always gets the list value 0)

So I need some input to do this in a better way, and not to make
asumptions like the one above.
Alternate I was thinking about dropping the default settings, deleting
everything and then copying it back onto the Default config.

So it looks similar to this (just with many more properties):

Dim swApp As SldWorks.SldWorks
Dim swmodel As SldWorks.ModelDoc2
Dim reval() As String
Dim i As Integer

Set swApp = Application.SldWorks
Set swmodel = swApp.ActiveDoc

reval = swmodel.GetConfigurationNames()
For i = 1 To UBound(reval)
swmodel.DeleteCustomInfo2 reval(i), "Modelnr"
swmodel.DeleteCustomInfo2 reval(i), "Betegnelse"
swmodel.DeleteCustomInfo2 reval(i), "Material"
swmodel.DeleteCustomInfo2 reval(i), "sMaterial"
swmodel.DeleteCustomInfo2 reval(i), "Mass"
swmodel.DeleteCustomInfo2 reval(i), "Designer"
swmodel.DeleteCustomInfo2 reval(i), "Edition"
swmodel.DeleteCustomInfo2 reval(i), "Date"
Next
From: That70sTick on
I have a macro for deleting custom properties.
<http://www.esoxrepublic.com/freeware/>
From: Ronni on
Thanks for inspiration, looks good and seems to work well.