請關注MCADEx官方網站: www.mcadex.com
IModelDoc2 * pMdl;
iSwApp->get_IActiveDoc2(&pMdl);
if (pMdl == NULL)
return S_FALSE;
//獲取Part
CComPtr<IPartDoc> pPart;
pMdl->QueryInterface(IID_IPartDoc, (LPVOID*)&pPart);
if (pPart == NULL)
return S_FALSE;
//獲取PartBox
VARIANT dPoint;
pPart->GetPartBox(FALSE, &dPoint);
//轉換Box為double
SAFEARRAY * psaBox = V_ARRAY(&dPoint);
double dExtent[6];//box的個頂點坐標
for ( long j=0; j < 6; j += 1 )
{
...
詳細請參考: http://www.mcadex.com/dom/blog_doc.php?channel_id=793328&username=ss20130113&id=44527