- Dim swApp As Object3 x2 i4 C+ P, S! ?2 K7 P$ d
$ W' l8 U, v6 @5 F) g+ W4 S4 K) b7 M- Dim Part As Object
4 b# P& N+ y+ K3 {8 k! E - Dim boolstatus As Boolean
+ j; ]$ O ?9 t m5 i - Dim longstatus As Long, longwarnings As Long
, U+ [+ b8 G! ~, z
% _1 }% d/ K. F6 S- Sub main() '删除所有配置属性6 s/ M& o: ^; x5 r6 t
3 A/ C2 V% d/ e- Set swApp = Application.SldWorks4 e, ?- F6 \) ]. [4 E7 u0 ?8 J
' u- M* r: R. F: `- Set Part = swApp.ActiveDoc) @0 l/ S' K- ~2 a; c \
0 j/ i! k8 z3 S+ H+ {2 J- CurCFGname = Part.GetConfigurationNames
6 W" g1 q- [- ]. N( g, [/ u, e
; A$ p8 A. F# e9 a* L) d( T- CurCFGnameCount = Part.GetConfigurationCount
/ _8 T r! G6 ?8 h# I
5 Y0 S* B! c7 ~6 ~" |5 m& ]- For i = 0 To CurCFGnameCount - 1
+ i3 G$ Q' x) C; t( c9 c2 |5 n* J" n
3 P9 h) i# h: A. K' D2 `- Set CusPropMgr = Part.Extension.CustomPropertyManager(CurCFGname(i))
. W/ T6 f% I% c+ S2 ]% } - - N$ K$ p3 }6 b
- Vnamearr = CusPropMgr.GetNames) p; P/ _) @" W% U
1 E6 @9 u3 [" g# d! H. v. j7 u- If Not IsEmpty(Vnamearr) Then) d( ^1 V9 N2 k! S) A& k) u
7 {8 ]- u3 V9 a; m% q# M2 C! O7 ^& f- For Each Vnamearr2 In Vnamearr" f3 F W' Z- J. _9 R
- " D" `1 X0 w" a$ T7 X' }- w5 Z
- bRet = Part.DeleteCustomInfo2(CurCFGname(i), Vnamearr2)5 f6 {. K; L D* }( V
- m% i& I) X( l4 y. C7 Y) i- Next3 n, ~- R6 ~. Y) R$ q* f, T
- B3 i1 c$ n8 I% f: X4 G3 q- End If
3 V/ ]7 [- I! K# J7 b - ' D: s, `! }% l$ d* `: R. k
- Next+ X$ }% Q/ ], |. p. D$ j6 `
复制代码
: b, M. W( ]7 n& ?$ m- \' Z7 D6 q
|