Solidworks二次开发—08--判断是什么特征

得到了一个特征feature,怎么判断是那种呢?

如果我们定义了一个特征对象:

dim curfeature as sldworks.feature

然后又通过SelectMgr得到了这个特征,然后可以使用feature.GetTypeName来判断是那种:

Select Case curfeature.GetTypeName

Case "Cut" '一个拉伸切除特征

do sth.

Case "HoleWzd" '一个异型孔特征

do sth.

Case Else

End Select

end select

这是语法:

Syntax (OLE Automation)

retval = Feature.GetTypeName ()

它会return一个

(BSTR) retval

Feature type as defined in BodyFeatures_e

其中 BodyFeatures_e 内容比较多,在这里都列出来也没什么用,大家可以参考solidworks API帮助。

(BSTR) retval

Feature type as defined in BodyFeatures_e

其中 BodyFeatures_e 内容比较多,在这里都列出来也没什么用,大家可以参考solidworks API帮助。

Published At
Categories with Web编程
Tagged with
comments powered by Disqus