How to add a parameter for drawing document?

  add, c++, caa, catia, drawing

I want to add a parameter to a drawing document in catia v5.
But I can not find a CAA function,
Some code I used:

HRESULT rs = S_OK;

CATInit* piInitOnDoc = NULL;
rs = pDrawingDoc -> QueryInterface(IID_CATInit, (void**) &piInitOnDoc);

const CATIdent idCATIContainer = "CATIContainer";
CATIContainer* piRootContainer = NULL;
piRootContainer = (CATIContainer*) piInitOnDoc -> GetRootContainer(idCATIContainer);
if(NULL != piRootContainer)
{
    CATICkeParmFactory* piFact = NULL;
    rs = piRootContainer->QueryInterface(IID_CATICkeParmFactory, (void**) &piFact);

    CATIParmPublisher* piPublish = NULL;
    rs = piRootContainer->QueryInterface(IID_CATIParmPublisher, (void**) &piPublish);

    CATICkeParm_var spBeamLength = piFact->CreateString("DrawingNo","FS-01-000099");
    piPublish->Append(spBeamLength);
}

Source: Windows Questions C++

LEAVE A COMMENT