HRESULT retval;
CComPtr<IModelDoc2>pModel;
retval = m_iSldWorks->get_IActiveDoc2(&pModel);
if(pModel == NULL)
{
AfxMessageBox(_T( "获取活动文档失败"));
return ;
}
CComPtr<IPartDoc>pPart;
pModel->QueryInterface(IID_IPartDoc,(LPVOID *)&pPart);
CComPtr<IFeature>pFeature;
pPart->IFirstFeature(&pFeature);
while (pFeature!=NULL)
{
CComPtr<IFeature>pSubFeature;
pFeature->IGetFirstSubFeature(&pSubFeature);
while(pSubFeature!=NULL)
{
CComBSTR bFeatureType;
pSubFeature->GetTypeName(&bFeatureType);
CString featureType (bFeatureType);
&

本文档介绍了如何通过Solidworks的二次开发接口遍历零件特征,从根特征开始,递归检查子特征,特别是针对ProfileFeature类型,获取其Sketch并显示名称。这个过程涉及到接口查询和类型判断,对于理解Solidworks的API使用和零件结构有帮助。
最低0.47元/天 解锁文章
910

被折叠的 条评论
为什么被折叠?



