- Dim swApp As Object2 P. I5 {3 f& S+ F3 g) l
- 4 n/ M/ \; y2 L) c5 H+ Q
- Dim Part As Object
: r6 S5 C2 S% ~. S5 r' Z2 l - Dim boolstatus As Boolean* @/ _- d/ ~& o2 V# Q/ X) q
- Dim longstatus As Long, longwarnings As Long
) t# ^, k# e" M' J: d" ` m - 0 `/ I: @6 q1 c1 d/ S
- Sub main() '删除所有配置属性
/ v% ?5 z* Q' m- d9 p - - p1 a$ G8 E- e% f. z( M
- Set swApp = Application.SldWorks4 e P6 T8 S; U) w3 \7 `
5 [; E) q, o6 I9 w- Set Part = swApp.ActiveDoc
6 ~1 o/ i) F; c1 r
* P( h* r1 K5 ~7 z9 d5 n, u- CurCFGname = Part.GetConfigurationNames# _0 Z" j- u- q( h
6 c* }) Z( ]' h# E- CurCFGnameCount = Part.GetConfigurationCount( ^/ @+ q' c7 G6 N: h$ f
* x4 [$ \* s9 u/ l- For i = 0 To CurCFGnameCount - 17 y& m: ?- E/ L- m6 J) X, _
1 V& R6 X. J( z! H# I: A- Set CusPropMgr = Part.Extension.CustomPropertyManager(CurCFGname(i))
( s u. ^1 P |! {" e. ?0 ~: W; b - # y, I+ L1 ~/ P& |+ J3 o
- Vnamearr = CusPropMgr.GetNames
$ R/ b5 I- Y1 Y- ?$ Q( `3 F; F - % k* ?, n* }- u/ x) ]
- If Not IsEmpty(Vnamearr) Then3 t% L/ q* q% ~$ j) q9 e5 @
- . V. Z' g7 @8 X
- For Each Vnamearr2 In Vnamearr' _, `8 N U# r1 b/ k# Y
# I" n6 `& M9 v0 p% Z9 o- bRet = Part.DeleteCustomInfo2(CurCFGname(i), Vnamearr2)
& ~; U$ { [" i7 m0 a
& B6 K" [1 M. P% U$ F2 ^4 x% M$ M6 @- Next
+ t- H0 N& m$ F% D - & ]6 m. w8 k7 u! s
- End If
9 V2 D3 T: i! @ - % O& Y( I6 d$ x" D
- Next
6 X. ~8 }7 g/ ?' X0 H. Z( W" v
复制代码 6 y8 F% N8 q% `4 d
1 t C3 ^4 W: [! ~ T* j: d
|