Hello everyone,
I'm a newcomer in sw api programming and beginner c++ user (just completing the sam's book).
I was trying to use IInsertCombineFeature() to make a substract combination from a part document. I'm kinda confuse in using this function. Please have a look my simplified declaration as follows:
:::::::::::::::::::::::::::::::::
CComPtr
CComPtr
CComPtr
CComPtr
CComPtr
CComPtr
CComPtr
.
.
.
hres = pFeatMgr->IInsertCombineFeature(SWBODYCUT, mainBody, 1, &otherBody, &pProd);
::::::::::::::::::::::::::::::::::
I could run the code, but always get an error of assertion problem from solidwork.exe in line 177 of atlcom.h. I believed the problem is located on otherBody. According to api, It should be pointed to an array of IBody2. I have tried to create the array by using dynamic and static declaration but always generates " ...no suitable conversion to SldWorks::IBody ** exist" error. That's why I tried to put a IBody2 pointer instead an array of IBody2.
::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::
However, I still possible to make the substract combination result after I retried to continue debugging twice.
Please let me know what happen and where lies the fault? Moreover, how to declare the array of IBody2?
Many thanks before, isnaini
SolidworksApi macros