- Dim swApp As Object
8 \& J1 l, s! S7 ]
! m6 U7 @; s! \3 C+ ]5 l7 n- Dim Part As Object
9 w9 Z" O8 r# ?0 N - Dim boolstatus As Boolean
# [2 R: k, p9 t' y! d. u - Dim longstatus As Long, longwarnings As Long7 H$ {4 q7 @4 m3 Y
- 3 e# e3 V/ t& `" I
- Sub main() '删除所有配置属性# |1 R% d1 W' e% O( F
2 ^2 ?& `9 e d3 }- K9 m9 H- Set swApp = Application.SldWorks
* Z5 Y* W5 J0 r - , |. u1 [8 v+ z0 ]' u( {) O
- Set Part = swApp.ActiveDoc
) K$ C' _- J9 w/ A5 s: }9 D9 Y
1 J* J8 Y5 O3 ]' o6 F5 h- CurCFGname = Part.GetConfigurationNames+ i# E( {; ~# y& [) Z
- 5 s) `+ b8 J2 z! X
- CurCFGnameCount = Part.GetConfigurationCount
% J( z7 G/ x+ l) f$ ]6 o# R# j
5 \- [$ h/ q. i. p) ~1 Y. p- For i = 0 To CurCFGnameCount - 1
$ {) K7 e E2 e+ c; I& @
; L3 A* v0 {$ X, b% _3 I# k8 ?- Set CusPropMgr = Part.Extension.CustomPropertyManager(CurCFGname(i))
' @+ _7 x, t2 ^) x' f; }8 K& e# k
/ p9 [. F1 P* Q- o0 |- Vnamearr = CusPropMgr.GetNames7 I1 `, A* i, e" ~3 c9 S$ {6 Y
- 0 [: n, J- g) u4 z) u- l
- If Not IsEmpty(Vnamearr) Then
5 @0 P( C m2 B; v
3 r. z& s t; n- For Each Vnamearr2 In Vnamearr2 l4 z( z- q3 T d
- ' d3 |4 `7 |1 H4 v8 d
- bRet = Part.DeleteCustomInfo2(CurCFGname(i), Vnamearr2)
/ u0 C' v' n. t. ?2 [& D2 }. u
# V+ v* k6 F7 j+ [$ N+ z" a; |- Next8 A9 p. s, _' b5 X: @) P4 n) V& e
8 k1 L$ P1 z) @+ V% M! a0 j- End If
4 s8 y8 W! o- w8 L C3 A5 x
# I* t$ {# N; t" d/ u# w+ K- Next4 M8 S" F9 O2 h9 C7 C+ i
复制代码 , \4 d; V9 O! f) ?$ e; w
- Q3 T+ U$ O2 G$ C |