MCADEx开发 SolidWorks二次开发 获取模型最大外形
请关注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