Creating a Loft
In order to create a loft, you need to have at least two shapes
already created as well as the spPrtFactory and spGSMFactory
factories created.
1a) Create a solid loft object using spPrtFactory, then using that, create a CATIGSMLoft. This basically makes the GSMFactory encapsulate the PrtFactory, enabling the PrtFactory loft to be able to use the methods of the GSMFactory loft.
CATISpecObject_var spLoft = spPrtFactory->CreateLoft(); CATIGSMLoft_var loft = spLoft;
1b) Create a surface loft by using the spGSMFactory, which returns a spGSMLoft.
CATIGSMLoft_var loft = spGSMFactory->CreateLoft();
2) Now we need to add sections to our loft. Add your sections using the following procedure:
loft->AddSection(spShape1); loft->AddSection(spShape2); loft->AddSection(spShape3); loft->AddSection(spShape4);
3) Now to cast the loft as a CATISpecObject_var and insert it into the part tree.
CATISpecObject_var spLoft2 = loft; spLoft2->Update(); spCurObj = spLoft2; spCurObj->InsertInProceduralView();