Reg : How to CreatePoint with Formula

Kalyan N

Reg : How to CreatePoint with Formula

Hi All,

How to create a Point with Formula? I'm trying to create a Point with a formula like this

Point = centerofgravity(Body). I'm trying with below shown Function. Kindly help me please..

HRESULT CAAStateCmd::CreateParamPoint(CATISpecObject_var &opPointElem, CATIContainer*  &piSpecContainer)

    HRESULT hr = S_OK;
    CATIGSMFactory_var spGSMFactory = piSpecContainer; //Factory Creation
    CATICkeParmFactory_var spCkeParmFactory = spGSMFactory;

    CATICkeParm_var pnt = NULL_var;
    pnt = spCkeParmFactory->CreateString("Point.1", "centerofgravity(Surface.1) ");

    CATCkeListOfParm  plistOfInputParm = new CATLISTV(CATBaseUnknown_var);

    CATICkeRelation_var spPntRelation = spCkeParmFactory->CreateFormula("Surface.1", "", "", pnt, plistOfInputParm,
        "centerofgravity(Horizontal\TSurfaceInput ) ", NULL_var, CATCke::True);

    CATICkeParm_var ParamPnt = NULL_var;
    ParamPnt = spGSMFactory->CreatePoint();

    CATIParmValuator_var piParmValuate = ParamPnt->Relation();
    if (piParmValuate == NULL || FAILED(hr))
        cout << "Failed to obtain piParmValuate" << endl;
        return E_FAIL;
    return hr;



Kalyan N

RE: Reg : How to CreatePoint with Formula
(in response to Kalyan N)

Hi all,

Somehow, I have progressed it by using another API GetCenterOfGravity. Created a Point by defining x,y,z at CoG,

For reference

double CoGX = pMassProperties3D->GetCenterOfGravity().GetX()*0.001;
double CoGY = pMassProperties3D->GetCenterOfGravity().GetY()*0.001;
double CoGZ = pMassProperties3D->GetCenterOfGravity().GetZ()*0.001;