几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   could you find a better or rapid search method to get all local coordinate systems? (http://www.dimcax.com/hust/showthread.php?t=300)

Robin 2006-12-04 10:22 PM

could you find a better or rapid search method to get all local coordinate systems?
 
Dear Robin,

My goal is to find all local coordinate systems from 5000 features. But it takes about 5 seconds when I try to iterate these features via the following code. I think that it is too slow for an iterative operation of features.

Could you help me find a better or rapid search method to get all local coordinate systems?

Thanks in advance.

My code as follows:

LPDISPATCH dFeature = NULL;

LPDISPATCH dNextFeature = NULL;

// import the supported features

while (dFeature != NULL)

{

IFEATURE swFeature(dFeature);

CString featureTypeName = swFeature.GetTypeName();

// is this a coordinate system feature

if (featureTypeName.Compare(swTnCoordinateSystem) == 0)

{

CString CSysName = swFeature.GetName();

// do simple things

}

// get next feature

dNextFeature = swFeature.GetNextFeature();

// release current feature

swFeature.DetachDispatch();

if (dFeature)

{

dFeature->Release();

dFeature = NULL;

}

dFeature = dNextFeature;

}

Robin 2006-12-04 10:24 PM

回复: could you find a better or rapid search method to get all local coordinate systems?
 
Hello ,
Have a look at FeatureManager.GetFeatures. While this will not filter on feature types, it will give you all of the features for that document.




Regards,

-Earl


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