2014-07-04 20:44:41|?次阅读|上传:wustguangh【已有?条评论】发表评论
关键词:C/C++, CAA, CATIA|来源:唯设编程网
一个产品文档组件是被CATIProduct接口处理的ASMProduct特征。考虑如下例子中一个这样的元素:isProdCont。GetReferenceProduct方法获取包含在零件文档CATProdCont容器中的参考特征, CATLinkableObject接口用这个特征给你包含这个特征的产品文档。
//...
CATIProduct_var spRef = ispProduct->GetReferenceProduct();
if ( NULL_var != spRef )
{
CATILinkableObject * piLinkableObject = NULL;
rc = spRef->QueryInterface( IID_CATILinkableObject, (void**)& piLinkableObject );
if ( SUCCEEDED(rc) )
{
// Do not release the document pointer
CATDocument * pDocument = NULL ;
pDocument = piLinkableObject->GetDocument();
//...
在零件文档实现的CATIContainerOfDocument(MecModInterfaces)接口使你可以获取指向产品容器的指针。
//...
CATDocument * pDocument = ...
CATIContainerOfDocument * pIContainerOfDocumentOnDoc = NULL ;
HRESULT rc = pDocument->QueryInterface(IID_CATIContainerOfDocument,
(void**)&pIContainerOfDocumentOnDoc)
if (SUCCEEDED(rc) )
{
CATIContainer * pIContainer = NULL ;
rc = pIContainerOfDocumentOnDoc->GetProductContainer(pIContainer);
}
//...
名称是CATPrtCont的结构定义容器,包含机械对象的设计,该设计由可以在结构树中显示的机械特征定义[图3]:
图3: 结构树
.jpg)
图中的Part1,xy plane,yz plane, zx plane, PartBody, Sketch和Pad.2都是机械特征。有3中类型的机械特征:
l 零件特征:包含要构建对象的设计的主要特征。
l 几何特征集合:包含其他几何特征集合或者几何特征的特征。
l 几何特征:那些有一个拓扑结果的特征(a CATBody[3])。