-
Re: Selecting a getting the previously selected data
Keith Rice Jan 22, 2015 3:26 AM (in response to Wasim Ahmed)-
Re: Selecting a getting the previously selected data
Wasim Ahmed Jan 22, 2015 4:20 AM (in response to Keith Rice)Thanks but it doesn't seem to work.
Here is the code i have used,
HRESULT hr = S_OK;
CComPtr<IModelDoc2> pModDoc;
hr = pSwApp->get_IActiveDoc2(&pModDoc);
CComPtr<ISelectionMgr> pSelMgr;
hr = pModDoc->get_ISelectionManager(&pSelMgr);
long l_Ind=1,l_Mk=-1;
CComPtr<IDispatch> pDisp;
hr = pSelMgr->GetSelectedObject6(l_Ind,l_Mk,&pDisp); //Getting all the selected sketch points
if (FAILED(hr) || !pDisp) return E_FAIL;
CComPtr<IModelDocExtension> pModExtn;
hr = pModDoc->get_Extension(&pModExtn);
CComVariant Var1;
hr = pModExtn->GetPersistReference3(pDisp, &Var1);
hr = pModDoc->ClearSelection2(VARIANT_TRUE);
long Err;
CComPtr<IDispatch> pDisp2;
hr = pModExtn->GetObjectByPersistReference3(Var1, &Err, &pDisp2);
// here i would like to know how do i select all the sketch points at once
-