超级版主
注册日期: 04-03
帖子: 18592
精华: 36
现金: 249466 标准币
资产: 1080358888 标准币
|
import annotation (Geometrical tolerance)
void CSolidWorksGeom::ImportAnnotation()
{
if (!CheckIsSWConnected() || !m_pModelDoc)
return;
// get the first annotation
LPDISPATCH dAnnotation = NULL;
IMODELDOC swModelDoc(m_pModelDoc);
LPDISPATCH dDocExt = swModelDoc.GetExtension();
if (dDocExt)
{
IMODELDOCEXT swModelDocExt(dDocExt);
long lgCount = swModelDocExt.GetAnnotationCount();
m_vParameters = swModelDocExt.GetAnnotations();
LPDISPATCH dNextAnnotation = NULL;
LPDISPATCH dGeomTol = NULL;
for(; dAnnotation; )
{
IANNOTATION swAnnotation(dAnnotation);
long lgType = 0;
lgType = swAnnotation.GetType();
switch (lgType)
{
case swGTol:
dGeomTol = swAnnotation.GetSpecificAnnotation();
ImportGeomTol(dGeomTol);
break;
default:
break;
}
dNextAnnotation = swAnnotation.GetNext();
if (swAnnotation)
swAnnotation.DetachDispatch();
dAnnotation = dNextAnnotation;
}
if (swModelDocExt)
swModelDocExt.DetachDispatch();
}
if (swModelDoc)
swModelDoc.DetachDispatch();
}
|