几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   SolidWorks二次开发 (http://www.dimcax.com/hust/forumdisplay.php?f=111)
-   -   Dear Robin, which body type need add a call to GetTessellation? (http://www.dimcax.com/hust/showthread.php?t=733)

yogy 2007-05-20 09:46 AM

Dear Robin, which body type need add a call to GetTessellation?
 
Q:
Subject: Dear Robin, which body type need add a call to GetTessellation? SR:1-407938223

Dear Robin,
My goal is to get all faces from one body up to speed.
There are two questions by now.
1. I want to know which body type need add a call to GetTessellation, before iterate all faces from a body.
2. Could you help me find a better or rapid search method to get all faces from a body? In my following code, it takes about 20 seconds when I try to iterate 5000 faces via the following code.
My code as below:
swBody.GetTessellation (vEmptyFaceList);
//……..
// Get dispatch Ptr to first face
dFace = swBody.GetFirstFace();
while (dFace)
{
// get next face
IFACE swFace(dFace);
dNextFace = swFace.GetNextFace();
swFace.DetachDispatch();
// do something
if (dFace)
{
dFace->Release();
dFace = NULL;
}
dFace = dNextFace;
}// while (dFace)
Yogy

yogy 2007-05-20 09:46 AM

回复: Dear Robin, which body type need add a call to GetTessellation?
 
R:
Hello,



I am a tad confused by your request. The GetTessellation object should work on either part bodies or temporary bodies.

For your second request, you might have a look at Body2.EnumBodies as an alternative. This may give you the added performance that you are looking for.





Regards,

-Earl


所有的时间均为北京时间。 现在的时间是 09:57 AM.