- Dim swApp As Object. ^/ B2 T. E* U) d8 u- ]! r+ ?# @
! o/ b2 d: N+ W$ W; x- Dim Part As Object! h; M; |& J' A* s/ b
- Dim boolstatus As Boolean
( K5 L( R9 \1 v# p" C4 @ - Dim longstatus As Long, longwarnings As Long
; _6 a$ U0 o3 ^7 G+ B7 g8 Q% [0 \/ x
9 G u$ l2 z8 z) J- Sub main() '刪除所有配置屬性! A1 F* ?3 a. Z. y! d& r
3 g2 E* x0 {4 Z5 k6 J$ o- Set swApp = Application.SldWorks- k; S) E& h0 P/ G+ o, H
% |% g8 ?' B% N% M9 {- Set Part = swApp.ActiveDoc
% N* J" }" p" D2 s - [2 }3 _& W) |- R
- CurCFGname = Part.GetConfigurationNames! k) H j! P& C, T* t
- $ ]* }7 {& r0 a; C
- CurCFGnameCount = Part.GetConfigurationCount% t' o: p/ o' K) d; Q9 h
( m6 K) r2 s R. B. S- e- For i = 0 To CurCFGnameCount - 1: o( M, Q" T5 x- F2 A( x y
- ' a$ w, E$ d2 p7 c% ~
- Set CusPropMgr = Part.Extension.CustomPropertyManager(CurCFGname(i))
G: x& I3 @% N$ |3 [ - 8 Q7 _& A+ z/ U; b- u
- Vnamearr = CusPropMgr.GetNames+ L" ?$ A9 d, b
- 9 s0 [- `* ?9 A: X T9 o
- If Not IsEmpty(Vnamearr) Then f9 b% o; N$ ?1 \, U
- 9 I+ g1 H% k5 T/ y0 U/ N6 A6 A
- For Each Vnamearr2 In Vnamearr6 P5 ?1 i4 n7 K" I$ E+ H, m
- , _0 n2 ?6 F. Y2 I% {9 ~& ~# j
- bRet = Part.DeleteCustomInfo2(CurCFGname(i), Vnamearr2)
; w# A; ^1 B8 t, h% t; a# [2 U
8 d: K6 Q/ R& P3 N7 \% b- Next" Q' Q0 ?' Y6 T# X! L& W) ~. {" X7 G
6 m8 a' W8 B* B9 J# e* Z+ M- End If
/ [% A- n/ O0 C" D% u# `
& k6 @% C5 C& D) k- Next$ r+ C4 ?# R) o+ @& C* v
復(fù)制代碼 % [5 @0 \4 w* v8 d; k) Y# [* |
8 |; A N1 W2 S% \% G P, a |