- Dim swApp As Object, f5 A! c3 j& O* k
- 4 y% c4 X3 b% K+ J% X2 M
- Dim Part As Object6 B+ A0 W$ ~# T+ |: }. h. e' X
- Dim boolstatus As Boolean
; ^ I+ K5 ~+ k# }9 M1 R: b - Dim longstatus As Long, longwarnings As Long
; A6 [3 o) X3 s. s. R - + i/ g ]4 F9 k1 e" ?6 k3 G5 @
- Sub main() '删除所有配置属性
C3 b3 U! n; ]7 S* R# j
( e9 C+ e& Z1 M, }% z" ~- Set swApp = Application.SldWorks
# {. g1 U; d7 v# ?# v - % ^1 _7 M' n3 [$ c, j; q( y
- Set Part = swApp.ActiveDoc
% [: @9 {% l& c; C U
0 Q u2 p5 R* }$ O- CurCFGname = Part.GetConfigurationNames8 |8 Q9 _' e9 I+ z+ `+ S- B M% T
( Q. g- F% Z, i* Q# }' R- CurCFGnameCount = Part.GetConfigurationCount% c: g8 v9 i4 Q( E& ~
8 n9 b; i& F/ v3 x- For i = 0 To CurCFGnameCount - 1, Z' h- V+ V2 b+ q
- / r1 P& C2 f8 D+ m4 w9 _. w8 F" J
- Set CusPropMgr = Part.Extension.CustomPropertyManager(CurCFGname(i))
8 w2 u* A' O" t/ k: r/ `
: v5 O2 u9 F" k' r* O% j6 q- Vnamearr = CusPropMgr.GetNames
4 G' g0 V) h( P8 o8 A: X
# J& P$ {4 b* z8 |& {9 r4 ^ D5 s- If Not IsEmpty(Vnamearr) Then
4 o8 h! N* k) ? - . M8 D$ e2 E x" [6 k: c
- For Each Vnamearr2 In Vnamearr5 C" _& ^1 T/ t
( p$ w/ Z3 w: I E2 j. M: I" m& z- bRet = Part.DeleteCustomInfo2(CurCFGname(i), Vnamearr2)
* p7 Q8 \% l$ A9 e3 q) d - ) A4 s. c- x: Q& t" D' C+ \+ _* ?# D
- Next/ u/ w' G& O \: z. ]' b- I
7 M3 Y# ?2 p* F% \- End If, C4 Q% v3 E9 d2 V7 S
- e& k3 b* W8 j! J$ c5 H5 `
- Next4 E, w+ v6 f: P a3 p _/ k" q
复制代码
, h6 Q4 B& H7 ?" }! t0 {6 `! Q( a4 ^0 h
|