- Dim swApp As Object
" e9 }6 P6 a+ r$ i8 b+ T1 B( M - # u- M6 O) W" C' {2 i
- Dim Part As Object- U8 U+ b& z3 C V( g
- Dim boolstatus As Boolean. ?8 `+ s2 U# V* @1 L: H0 [$ x# A9 ^% Q
- Dim longstatus As Long, longwarnings As Long
# O* Y0 I) N& ^
7 N6 C4 A |. a2 C+ S, ~- Sub main() '刪除所有配置屬性
4 v O/ U, s# }. k& M1 m
! O, D" g0 Y5 @. `2 Z- Set swApp = Application.SldWorks
9 \3 x, n1 z6 C - 1 P( }' Y+ b; t" {5 Y0 X
- Set Part = swApp.ActiveDoc3 l% s2 ^# x& ?8 ? C+ B& [& e5 B
. V+ I, F' \: ~4 l- U2 p$ N6 C0 {- CurCFGname = Part.GetConfigurationNames3 k' z+ g$ ]3 d/ o5 e; j/ A$ _( j
% s& N6 @4 k. Q- CurCFGnameCount = Part.GetConfigurationCount
9 e6 w: k( }# d, G4 e
1 c0 o g/ }7 k2 M: m, T- For i = 0 To CurCFGnameCount - 1
6 @3 d3 R6 R* ^6 b
1 E! ^$ b& x! a$ j- Set CusPropMgr = Part.Extension.CustomPropertyManager(CurCFGname(i))
# ~1 F% L; M- Y8 D; E+ G
0 h/ V8 ]' B1 j% N; O: b# o9 F- Vnamearr = CusPropMgr.GetNames$ D, Y' a& W' U! {" t& L0 e5 E
- $ T1 k- ?4 p. Z! W) ?3 l( A+ J* n
- If Not IsEmpty(Vnamearr) Then; `4 c4 V' X' J- f7 U1 K* x
- - C0 a( l5 J e# x. y. c+ r+ ^4 n
- For Each Vnamearr2 In Vnamearr2 j9 D% R! B" h- F
- + ^. w" [0 Q2 r7 W. ~. E* U
- bRet = Part.DeleteCustomInfo2(CurCFGname(i), Vnamearr2)1 m8 R: d9 W1 ^
- 3 E9 \1 ^ ~1 J1 _$ o
- Next' I* A+ E% p( ?7 q
% s$ {# H! W7 v! ?- End If2 Q+ _! s* K' \9 W( ?
- 4 J. f: |/ f' Y2 W4 L% w
- Next; g9 d, _: S, \3 z
復制代碼
" t* l$ i/ `) x( W, f' f6 i4 x4 p6 u4 m* N/ z" `+ {. ]5 b: F
|