SW宏-删除所有配置属性
Dim swApp As ObjectDim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main() '删除所有配置属性
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
CurCFGname = Part.GetConfigurationNames
CurCFGnameCount = Part.GetConfigurationCount
For i = 0 To CurCFGnameCount - 1
Set CusPropMgr = Part.Extension.CustomPropertyManager(CurCFGname(i))
Vnamearr = CusPropMgr.GetNames
If Not IsEmpty(Vnamearr) Then
For Each Vnamearr2 In Vnamearr
bRet = Part.DeleteCustomInfo2(CurCFGname(i), Vnamearr2)
Next
End If
Next
删除所有自定义属性
Sub main() '删除自定义属性
Dim swApp As Object
Dim swModel2 As SldWorks.ModelDoc2
Dim vCustInfoNameArr2 As Variant
Set swApp = _
Application.SldWorks
Set swModel2 = swApp.ActiveDoc
vCustInfoNameArr2 = swModel2.GetCustomInfoNames
If Not IsEmpty(vCustInfoNameArr2) Then
For Each vCustInfoName2 In vCustInfoNameArr2
bRet = swModel2.DeleteCustomInfo(vCustInfoName2)
Next
End If
End Sub
谢谢楼主,保存先,后面应该有用 感觉楼主分享,适用于哪个版本呢? 远祥 发表于 2019-11-19 18:11
感觉楼主分享,适用于哪个版本呢?
宏是不分版本的,适用于SW任何版本。
那位麻烦告诉一下,我复制这些代码怎么变了内容? 这两个宏可以合并嘛 牛,今天帮我解决实际问题了,谢谢
页:
[1]