- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Even manually I'm not able to add a WorkPoint in an arbitrary position in an Assembly file, and not even on a Sketchpoint. But I noticed that the assembly document has a list of WorkPoints so I tried programatically adding a work point, but though there's no error return values the point does not seem to get added.
Is this possible either manually or programatically?
Here is the code:
CComPtr<WorkPoints> pWorkPointsList ;
hRes = pAssemblyCompDef->get_WorkPoints (&pWorkPointsList) ;
if (FAILED(hRes) || (pWorkPointsList == nullptr)) {
ShowCOMError (hRes,L"could not get workpoint list") ;
return ;
}
CComPtr<Point> pPt; // Create a 3d point
hRes = theApp.GetTransGeomPtr()->CreatePoint(0.5,0.5,0.0,&pPt);
if (FAILED(hRes)) {
ShowCOMError (hRes,L" CreatePoint failed") ;
return ;
}
hRes = pWorkPointsList->AddFixed (pPt,TRUE) ;
if (FAILED(hRes)) {
ShowCOMError (hRes,L"AddDFixed failed") ;
return ;
}
Solved! Go to Solution.