PRO_E_CRV_IP_REF1 element for curve type feature creation using toolkit
Hi
I am trying to create intersect feature using toolkit. This feature is created manually using datum plane and surfaces of extrude feature.
What I need to do for toolkit is to create feature of type PRO_FEAT_CURVE using in header file PRODTMCRV. Type should be Feature - Intersect Curve defined as PRO_CURVE_TYPE_INTSRF. While adding surfaces, I thought to have PRO_CURVE_TYPE_INTSRF as multiple selections of surfaces.
In case of single surface, I could have used API ProElementReferenceSet(), but what need to be done in case of multiple surfaces to be passed as value to this element.
I have used below code to set multiple surfaces into element called "PRO_E_CRV_IP_REF1 " , but it is not working properly.
ProElement objElementSrfCollection;
status = ProElementAlloc(PRO_E_STD_SURF_COLLECTION_APPL, &objElementSrfCollection);
ProCollection objSrfCollection;
status = ProSrfcollectionAlloc(&objSrfCollection);
ProSrfcollinstr objSurfCollectInstruction;
status = ProSrfcollinstrAlloc(PRO_SURFCOLL_SINGLE_SURF, PRO_B_TRUE, &objSurfCollectInstruction);
status = ProSrfcollinstrIncludeSet(objSurfCollectInstruction, PRO_B_TRUE);
for (int i = 0; i < vectReferenceOfSurfaces.size(); ++i)
{
ProSrfcollref objSurfCollectRef;
status = ProSrfcollrefAlloc(PRO_SURFCOLL_REF_SINGLE, vectReferenceOfSurfaces[i], &objSurfCollectRef);
status = ProSrfcollinstrReferenceAdd(objSurfCollectInstruction, objSurfCollectRef);
}
status = ProSrfcollectionInstructionAdd(objSrfCollection, objSurfCollectInstruction);
status = ProElementCollectionSet(objElementSrfCollection, objSrfCollection);
ProElement objElementIPRef1;
status = ProElementAlloc(PRO_E_CRV_IP_REF1, &objElementIPRef1);
status = ProElemtreeElementAdd(objElement_IPCompRef1, NULL, objElementIPRef1);
status = ProElemtreeElementAdd(objElementIPRef1, NULL, objElementSrfCollection);
Note: vectReferenceOfSurfaces is vector of ProReference for all required surfaces.
Any thought would be of great help.
Regards
Ketan

