Create VARIANT array from selection set

Hi everybody!

I like to create in a drawing sketch a line tangent to a circle using C++ / COM like below:

HRESULT hr = S_OK;

CComPtr pModel;

hr = iSwApp->get_IActiveDoc2(&pModel);

CComPtr swSelectionManager;

pModel->get_ISelectionManager(&swSelectionManager);

Up to here I've got my selected circle and line in swSelectionManager , everything is just fine but I do not know how to pass them to the AddRelation(...) as VARIANT Entities, like below:

VARIANT vSelectionSet;

CComPtr swSketchRelation;

swSketchRelManager->AddRelation(vSelectionSet,swConstraintType_TANGENT,&swSketchRelation);

Best regards!

Ioan

SolidworksApi macros