Creating a Line CAA RADE
After creating the GSMFactory and PrtFactory (See Creating a Point in CAA RADE for more details on this) you can create a line by following these steps:
1) Create 2 points and cast them as CATISpecObjects as shown in the code below:
double Coords[3]; Coords[0] = 0; Coords[1] = 0; Coords[2] = 0; CATIGSMPoint_var spPoint1 = spGSMFactory->CreatePoint(Coords); //Creates a point CATISpecObject_var spSpecPoint1 = spPoint1; //Casts the point as a CATISpecObject Coords[0] = 8; Coords[1] = 6; Coords[2] = 7; CATIGSMPoint_var spPoint2 = spGSMFactory->CreatePoint(Coords); CATISpecObject_var spSpecPoint2 = spPoint2;
2) Create a line using the points that you created previously and cast it as a CATISpecObject using the code below:
CATISpecObject_var spSupport = NULL_var; CATIGSMLinePtPt_var spLine1 = spGSMFactory->CreateLine(spSpecPoint1, spSpecPoint2, spSupport); CATISpecObject_var spSpecLine1 = spLine1;
3) Update the line, make it the current object and insert it into the procedural view using the code shown below:
spSpecLine1->Update(); CATIGSMProceduralView_var spCurObj = spLine1; spCurObj->InsertInProceduralView();