添加参数代码大致如下:
CATFrmEditor *_FrmEditor = CATFrmEditor::GetCurrentEditor();
CATDocument *_Document = _FrmEditor -> GetDocument();
CATInit *pInitOnDocument = NULL ;
_Document->QueryInterface(IID_CATInit,(void **) &pInitOnDocument);
CATIPrtContainer *pIPrtContOnDocument = NULL ;
pIPrtContOnDocument = (CATIPrtContainer*)pInitOnDocument->GetRootContainer("CATIPrtContainer");
CATICkeParmFactory *pCkeParFact = NULL;
pIPrtContOnDocument -> QueryInterface(IID_CATICkeParmFactory, (void**) &pCkeParFact);
CATICkeParm_var spParm = pCkeParFact->CreateLength ("paramLength",0);
CATCkeGlobalFunctions::GetFunctionFactory()->AddToCurrentParameterSet(spParm);
我用此方法在一个新建的Part文件中添加后参数后在树上可以显示,但是尝试在CATIA删除却提示"You can delete only the new parameters that you have added to the part.
The parameters created for each feature can be deleted only by deleting the feature itself."
如果不通过程序直接在CATIA建的参数都可以删的,请高手指教CAA中有没有其他添加可删除的参数的方法或能删除以上参数的方法.