二次开发第一要义:查帮助

CAA创建三坐标点的函数帮助如下:

public virtual CATIGSMPointCoord_var CreatePoint( const CATICkeParm_var iFirstCoord,

const CATICkeParm_var iSecondCoord,

const CATICkeParm_var iThirdCoord) = 0

解释:创建笛卡尔坐标系下的点

Parameters:

iFirstCoord:iX coordinate for the point

iSecondCoord:iY coordinate for the point

iThirdCoord:iZ coordinate for the point

Returns: CATIGSMPointCoord_var created point

See also: CATIGSMPointCoord

示例代码如下:

CATFrmEditor * pEditor=CATFrmEditor::GetCurrentEditor();

if (NULL==pEditor)

{

MessageBox(NULL,L"hello",L"Failed to get Editor!",MB_OKCANCEL);

}

CATDocument * pDoc=pEditor->GetDocument();

MessageBox(NULL,pDoc->DisplayName(),L"The current document you opened is",MB_OKCANCEL);

CATIContainerOfDocument_var spConDocs=pDoc;

CATIContainer * pSpecContainer=NULL;

HRESULT hr=spConDocs->GetSpecContainer(pSpecContainer);

if (NULL_var==spConDocs)

{

MessageBox(NULL,L"hello",L"转化失败!",MB_OKCANCEL);

}

CATIGSMFactory_var spGSMFactory=NULL_var;

CATIPrtFactory_var spPrtFactory=NULL_var;

CATICkeParmFactory_var spParmFactory=NULL_var;

spGSMFactory=pSpecContainer;

spPrtFactory=pSpecContainer;

spParmFactory=pSpecContainer;

CATICkeParm_var spParmX=spParmFactory->CreateReal("PointX",_EditorX->GetValue());

CATICkeParm_var spParmY=spParmFactory->CreateReal("PointY",_EditorY->GetValue());

CATICkeParm_var spParmZ=spParmFactory->CreateReal("PointZ",_EditorZ->GetValue());

CATIGSMPointCoord_var spPoint =spGSMFactory->CreatePoint(spParmX,spParmY,spParmZ);

CATISpecObject_var spSpecPoint=spPoint;

spSpecPoint->Update();

CATIGSMProceduralView_var spPntObj=spSpecPoint;

spPntObj->InsertInProceduralView();

catia获取点的坐标值和矢量值(CATIA二次开发CAA)(1)

,