Solidworks api (IAddBodies)
- From: "kurtinpunk" <kurtinpunk@xxxxxxxxx>
- Date: Wed, 05 Mar 2008 18:59:37 -0600
Hi,
I am coding to implement to extract mass property from given part file
using C++
I want to add bodies using MassProperty.IAddBodies()
However, whenever nBodyCount is bigger than 1, IAddBodies function does
not work. in fact, program downs.
I have tried several things and to find related reference but I could
not.
Thus can you help me?
Code is following
...
hres = comp->GetBodies2(swSolidBody, &vBodyArr);
SAFEARRAY *pSafeArrBody = V_ARRAY(&vBodyArr);
LPDISPATCH *pDispArrBody = NULL;
long nBodyCount = -1;
long nBodyHighIndex = -1;
hres = SafeArrayAccessData(pSafeArrBody, (void **) &pDispArrBody);
(*pDispArrBody)->QueryInterface(__uuidof(IBody2),
reinterpret_cast<void**>(&pBodyArr));
hres = SafeArrayGetUBound(pSafeArrBody, 1, &nBodyHighIndex);
nBodyCount = nBodyHighIndex + 1;
(*massProperty)->IAddBodies(nBodyCount, &pb, &isAdded);
...
Thanks
--
Message posted using http://www.talkaboutcad.com/group/comp.cad.solidworks/
More information at http://www.talkaboutcad.com/faq.html
.
- Prev by Date: Re: Problem with driveworks
- Next by Date: Re: SW and multiple cores
- Previous by thread: PhotoWorks Render Wizard - Quality Slider?
- Next by thread: How to use the Linear Spring Physical Simulation feature
- Index(es):