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

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

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)

,

免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com

    分享
    投诉
    首页