- Dim swApp As Object6 P* u8 _; s E
: Q/ C9 U @' N7 k' a* I- Dim Part As Object
) u$ f, D! t' H$ V' l* B) T7 t - Dim boolstatus As Boolean
7 B5 c' F7 D& _ - Dim longstatus As Long, longwarnings As Long
/ a V. H/ W- i$ t! u2 q% o
4 p- l! p* O. \! W; t- Sub main() '刪除所有配置屬性0 i5 K& L% W0 N1 f
0 Z, f1 B8 Z, o! U" Z E- Set swApp = Application.SldWorks
* k1 i) ?* l @
& e* M) H' P8 b9 Y" d7 y- Set Part = swApp.ActiveDoc
+ z. R2 I6 H W; S - ) m" a( l9 C: {# s0 l. p
- CurCFGname = Part.GetConfigurationNames/ m7 [( l' b" R! n8 [. T
& Y* U4 q4 R1 u; Y: B- CurCFGnameCount = Part.GetConfigurationCount4 y" q8 D, g& I. }" p/ G8 o f/ @
- " t8 R8 I) |) i
- For i = 0 To CurCFGnameCount - 1# R) y. ?* |7 I6 }3 `* M& |
' u. \8 f u2 t4 f- Set CusPropMgr = Part.Extension.CustomPropertyManager(CurCFGname(i))
- v q* u' [# b: ^: e; m
! i! U2 U, `% C9 k) u- Vnamearr = CusPropMgr.GetNames
& {# A5 R: X9 j* l# X9 t' ?* d9 s
* l! N$ L) H: ~) S6 f( J8 c' l F- If Not IsEmpty(Vnamearr) Then
( d- |, |, P: V D) p9 ]1 B8 Z w - / S V. f) D1 V; p* ]
- For Each Vnamearr2 In Vnamearr
0 ^& P+ e, n: C
+ N% s6 o1 z9 G6 B; h- bRet = Part.DeleteCustomInfo2(CurCFGname(i), Vnamearr2)
9 v- S4 ?. N7 S4 W a
% ]( E0 q2 b$ G- R' O8 X$ g6 D( l" {8 S- Next. h# l+ @* q* z! O
- 7 ^0 a' l8 E6 ?& ]6 K/ r7 ~
- End If0 M0 s. @# C. \- j5 y, Q- U3 v
- $ y4 j- c! Q9 {9 W
- Next
( E% O* |9 e/ ~) A$ A% @
復制代碼
, P- _' N- X( z' T6 o. u; f+ K( y; g& m/ V
|