AnsweredAssumed Answered

Comparing Custom Properties

Question asked by Jean-Baptiste Bouckaert on Jul 7, 2016
Latest reply on Jul 7, 2016 by Viktor Bovzdarenko

Hi, I'm writing a macro to edit the custom properties in a drawing.

 

These custom properties can vary from drawing to drawing so I made a few documents, one for each possible combination of properties. Now I'd like to write a macro with wich I can read wich properties are present in the "standardized" document and then compare these to the original document and delete what I don't need and I add what I do need. I don't really know where to start from here.

 

I'm kinda thinking it has something to do with

 

   ' For each custom property, print its type, value, and resolved value

    For j = 0 To nNbrProps - 1

        lRetVal = cusPropMgr.GetAll2(vPropNames, vPropTypes, vPropValues, resolved)

        custPropType = cusPropMgr.GetType2(vPropNames(j))

        Debug.Print "    Name, swCustomInfoType_e value, and resolved value:  " & vPropNames(j) & ", "; custPropType & ", " & ResolvedValOut

    Next j

 

As explained in the article: 2014 SOLIDWORKS API Help - Get Custom Properties for Configuration Example (VBA)

 

But I really don't know for sure.

 

Greetings.

Outcomes