Select a configuration of a part in context via macro - VBA

Hi all

I currently have a "piping" piece in which two flanges are inserted at the ends (in the context of the blow). I would like to point out that it is not an assembly, but a part.

My clamps have different configurations depending on their size, I would like to be able to choose the desired one via a macro (which would take the right reference from an Excel file).

Like what:

A flange (SolidWorks 3D file) has the following different configurations "Ø10", "Ø20", "Ø30", ... and in an excel file I have a cell that is equal to "Ø20". The goal would be for the macro to select the right configuration of the flange that is inserted into another part (it is not an assembly, but a part).

I have a lead with this line:

        bRet = swConfigMgr.GetConfigurationParams(vConfName(i), vConfParam, vConfValue)
But it doesn't work...

Basically usually I could control a part family and use "$CONFIGURATION@Bride = Ø20". But in my case I would like not to use a family of parts and only go through the macro (to avoid too long loading times). This is possible for coast steering with the function:     "Part.Parameter(name). SystemValue = rating / 1000" but to change the configurations it doesn't work.
 

If you have any ideas, I'm all for it.

 

Thanks in advance,