2024年3月21日发(作者:)

建立点、线、面、圆有很多种方法,可以根据不同的参考,具体其他方法查阅API

CreatePoint

public virtual CATIGSMPointCoord_var CreatePoint( const CATICkeParm_var iFirstCoord,

const CATICkeParm_var iSecondCoord,

const CATICkeParm_var iThirdCoord) =0

功能:根据空间坐标创建点

参数:X/Y/Z坐标

示例:

double Coords[3]; //创建一个三维数组(x,y,z)定义点坐标

double Coords[3] = {100,0,0};

Coords[0] = 100;

Coords[1] = 0;

Coords[2] = 0;

CATISpecObject_var spSpecPoint1=spGSMFactory->CreatePoint(Coords);

spSpecPoint1->Update();

CATIGSMProceduralView_var spPntObj = spSpecPoint1;

spPntObj->InsertInProceduralView();//添加到视图中

CreatePoint

public virtual CATIGSMPointTangent_var CreatePoint( const CATISpecObject_var iCurve,

const CATIGSMDirection_var iDirection) = 0

功能:根据曲线和切线切点创建点

参数:曲线、方向

CreatePoint

public virtual CATIGSMPointCenter_var CreatePoint( const CATISpecObject_var iCurve) = 0

功能:根据圆的圆心创建点

参数:圆、

CreateLine

public virtual CATIGSMLinePtPt_var CreateLine( const CATISpecObject_var iPoint1,

const CATISpecObject_var iPoint2,

const CATISpecObject_var iSupport = NULL_var) = 0

功能:两点间创建一条直线

参数:点1、点2

示例:double Coords[3];

Coords[0] = 0;

Coords[1] = 0;

Coords[2] = 0; //创建一个三维数组(x,y,z)定义点坐标

CATIGSMPoint_var spPoint1 = spGSMFactory->CreatePoint(Coords); //Creates a point,(创建一个

CATIGSMPoint并将其转换为CATISpecObject)

CATISpecObject_var spSpecPoint1 = spPoint1; //Casts the point as a CATISpecObject

Coords[0] = 80;

Coords[1] = 60;

Coords[2] = 70;

CATIGSMPoint_var spPoint2 = spGSMFactory->CreatePoint(Coords);

CATISpecObject_var spSpecPoint2 = spPoint2;

CATISpecObject_var spSupport = NULL_var; //用创建的点创建一条线,并转换为

CATISpecObject

CATIGSMLinePtPt_var spLine1 = spGSMFactory->CreateLine(spSpecPoint1, spSpecPoint2,

spSupport);

CATISpecObject_var spSpecLine1 = spLine1;

CreatePlane

public virtual CATIGSMPlaneAngle_var CreatePlane( const CATISpecObject_var iPlane,

const CATISpecObject_var iRotationAxis,

const CATICkeParm_var iAngle,

const CATGSMOrientation iOrientation) = 0

功能:根据一个平面和角度创建另一个平面

示例:

CATICkeParm_var iAngle=spCkeFact -> CreateAngle ("Angle", (90/180.)*CATPI);

CATIGSMPlaneAngle_var

lfbpm=spGSMFactory->CreatePlane(xpm,bjlzx,iAngle,CATGSMSameOrientation);

CreateLength

public virtual CATICkeParm_var CreateLength( const CATUnicodeString& iParameterName,

const double iParameterValue) = 0

功能:创建长度参数

参数:参数名、公式

CATICkeParm_var iLength1=spCkeFact -> CreateLength ("Length1", disp12/1000+0.1);

CreateCircle

public virtual CATISpecObject_var CreateCircle( const double* iPoint, const double iRadius) = 0

功能:根据圆心和半径创建圆