在此基础上,创建线的步骤如下: 1)创建两个点并将其转换为CATISpecObjects。 double Coords[3]; Coords[0] = 0; Coords[1] = 0; Coords[2] = 0; CATIGSMPoint_var spPoint1 = spGSMFactory->CreatePoint(Coords); CATISpecObject_var spSpecPoint1 = spPoint1; Coords[0] = 8; Coords[1] = 6; Coords[2] = 7; CATIGSMPoint_var spPoint2 = spGSMFactory->CreatePoint(Coords); CATISpecObject_var spSpecPoint2 = spPoint2; 2) 利用创建的点创建一条线,并将其转换为CATISpecObject CATISpecObject_var spSupport = NULL_var; CATIGSMLinePtPt_var spLine1 = spGSMFactory->CreateLine(spSpecPoint1, spSpecPoint2, spSupport); CATISpecObject_var spSpecLine1 = spLine1; 3) 更新创建的线,并将其添加到视图中。 spSpecLine1->Update(); CATIGSMProceduralView_var spCurObj = spLine1; spCurObj->InsertInProceduralView();
' W2 ?: h/ v, A4 J# g1 f4 q |