删除所有自定义属性8 y" l% k* y( b- V" E
- Sub main() '删除自定义属性; s8 ~; [3 i" g7 ^: o
- Dim swApp As Object4 ]$ P9 {, r5 ~% G# q
- Dim swModel2 As SldWorks.ModelDoc2
$ i1 @5 t8 a$ c8 H
- Dim vCustInfoNameArr2 As Variant
1 k j4 ?2 ^+ k" T R) y& R, z
2 a) j/ Q! Y$ h0 B, _
- Set swApp = _
" F8 H# Z0 { \5 }
- Application.SldWorks: Q8 F$ D3 ]1 O1 ~
& \9 c/ k" ? [$ q5 b0 i
- Set swModel2 = swApp.ActiveDoc/ A8 c. c; [. r) c
/ ^1 t/ S/ y9 N, ?0 p- k$ H
- vCustInfoNameArr2 = swModel2.GetCustomInfoNames: S' I- M9 y# W' T% e/ O4 I' X
8 @0 Q" K, S: t/ b
- If Not IsEmpty(vCustInfoNameArr2) Then. x, L8 {$ Z* u* r
- For Each vCustInfoName2 In vCustInfoNameArr2
1 q6 k, T$ V0 \
- bRet = swModel2.DeleteCustomInfo(vCustInfoName2)
2 [! f: o {* H! F, f$ @
- Next
) {$ t- v1 h+ ~
- End If, P7 g8 O* A- g& N' c4 O: ^
- End Sub0 w* ?3 ~+ [0 G
复制代码
|