哪位大师知道,我想装配体中的配合有时候修改一个,好多错误了,我想找出错误的配合都删除,遍历配合但不知道怎么判断那个配合是错误?
Set swApp = Application.SldWorks
' fileName = "C:\Users\Public\Documents\SOLIDWORKS\SOLIDWORKS 2018\samples\tutorial\api\simple-block.sldasm"
' Set swModel = swApp.OpenDoc6(fileName, swDocumentTypes_e.swDocASSEMBLY, swOpenDocOptions_e.swOpenDocOptions_Silent, "", errors, warnings)
Set swModel = swApp.ActiveDoc
'Get the first feature in the assembly
Set swFeat = swModel.FirstFeature
'Iterate over features in FeatureManager design tree
Do While Not swFeat Is Nothing
swFeat.SetUIState swIsHiddenInFeatureMgr, True
If "MateGroup" = swFeat.GetTypeName Then
Set swMateFeat = swFeat
Exit Do
End If
Set swFeat = swFeat.GetNextFeature
Loop
Debug.Print " " & swMateFeat.Name
Debug.Print ""