Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swFeat As SldWorks.Feature
Dim swSubFeat As SldWorks.Feature
Dim k As Integer
Dim Flatten_() As Variant
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swFeat = swModel.FirstFeature
Do While Not swFeat Is Nothing
If swFeat.GetTypeName = "FlatPattern" Then
Set swSubFeat = swFeat.GetFirstSubFeature
Do While Not swSubFeat Is Nothing
ReDim Preserve Flatten_(k)
Flatten_(k) = swSubFeat.Name
k = k + 1
Set swSubFeat = swSubFeat.GetNextSubFeature()
Loop
问题还是没有解决的,这段代码只是方便一键还原而已,至于求助问的,怎么出现的,是否有还原api还是未知。求高手!作者: tg000057 时间: 2022-3-14 11:31
这样用可以 ,
Dim swFeat As SldWorks.Feature '°ÑÕ1¿aÕÛíä½aÑ1Ëõ
Dim swSubFeat As SldWorks.Feature
Set swFeat = swModel.FirstFeature
Do While Not swFeat Is Nothing
If swFeat.GetTypeName = "FlatPattern" Then
Set swSubFeat = swFeat.GetFirstSubFeature
Do While Not swSubFeat Is Nothing
swSubFeat.SetSuppression2 2, 1, ""
Set swSubFeat = swSubFeat.GetNextSubFeature()
Loop