- Dim swApp As Object
3 `6 R& p! v% W - 2 P( F3 M4 O; o+ |! E T1 ?% @1 K
- Dim Part As Object+ h1 K8 w- t. y( Z& l3 o! n. y2 p
- Dim boolstatus As Boolean
9 B& e" o; J/ V4 @1 K- ~6 v - Dim longstatus As Long, longwarnings As Long
* ^% b$ V. U6 k- V! R+ m. O2 H - 5 D( M" p4 r+ U1 G$ k# f% T% W
- Sub main() '删除所有配置属性, {6 G$ a# k2 ~9 z$ L% f( M1 i
- ; R# ~! w/ V, F: r3 ~
- Set swApp = Application.SldWorks
* K' k$ t I9 `
4 D4 l. J- r3 u7 \( e- Set Part = swApp.ActiveDoc' G% I$ v0 w. b N
* {% I( b4 Z6 R( W# u" S/ t' h: t- CurCFGname = Part.GetConfigurationNames
+ N- D* t, c" `$ d - . G5 f* }# F4 E
- CurCFGnameCount = Part.GetConfigurationCount6 F; \6 {9 x9 ?) u* @1 v
- 6 x9 Q9 ]1 G8 b- M( y4 h
- For i = 0 To CurCFGnameCount - 1
, K& X3 F# s: R( J, r; j9 o* G7 C - , q( x: Z9 j; f, V
- Set CusPropMgr = Part.Extension.CustomPropertyManager(CurCFGname(i))
3 U, B4 a" ?) V$ N8 ~% y' h
& v! B$ H0 o1 \ H' ?4 x9 T H- Vnamearr = CusPropMgr.GetNames
4 b4 P5 Z6 ?8 x0 y7 i+ W0 U: k
9 ^7 K& Y! l9 I( m7 d- If Not IsEmpty(Vnamearr) Then- S; O% C: I# L+ `
- , {! {# o/ b3 f8 H5 C# `8 {
- For Each Vnamearr2 In Vnamearr# Y8 h& {/ j) f" f
- 9 `6 u. a1 u( x, c
- bRet = Part.DeleteCustomInfo2(CurCFGname(i), Vnamearr2)
0 D' A0 y7 N) j1 v( a - % k5 H6 U. t* |, O
- Next
8 w" G1 n# P+ ]5 `, m( ] - 9 D# l X- Y3 ^ s0 {& F* Z5 D+ @# O
- End If( W- q2 R6 M4 p9 I$ f
- 5 j. A6 d7 k& d. v! S; }- b
- Next
. ?1 z8 {) x+ b
复制代码 * e" M6 d; e% j$ i, }" M4 T8 m
3 D+ s$ P# }" w |