日期:2014-01-23  浏览次数:20499 次


得到了一个特征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帮助。