- Dim swApp As Object
/ F- h6 D9 S" h
6 N, g! Z0 ?) T) E6 s3 e$ b$ t- Dim Part As Object+ g# N' j5 Z1 H/ H- U
- Dim boolstatus As Boolean
( S( Q) X: B3 t6 I* ^ - Dim longstatus As Long, longwarnings As Long( e, k5 U) e6 a. g8 q# z: b; Z, s# {* P$ q
- 9 P: M: Z- }; R+ r
- Sub main() '删除所有配置属性! W0 W# k% [$ u; a
- . `; n$ U3 i6 w: \% A E
- Set swApp = Application.SldWorks2 A3 }) X. Z& S+ |
- - o( k& R/ l( e. p
- Set Part = swApp.ActiveDoc0 X, W, A4 }7 _3 l; }
- ! `. G3 j9 _- f U U/ d+ T. q
- CurCFGname = Part.GetConfigurationNames
2 g" N4 U" N3 ^1 {3 f1 {5 P* R
' I- K# P7 C1 @6 [" a- CurCFGnameCount = Part.GetConfigurationCount
; d5 J& ^6 x. d* o
. k0 |. ~* r1 t0 M; s. z4 w- For i = 0 To CurCFGnameCount - 19 {& `. S, u# [. x
- ; G1 E- S8 `" M$ N1 t
- Set CusPropMgr = Part.Extension.CustomPropertyManager(CurCFGname(i))
$ H" \& Q7 u' k+ F
( z. K3 @, i& C, Z% P- Vnamearr = CusPropMgr.GetNames
G' T8 D# C0 R/ c" ~7 I7 L/ x - . m8 ~+ c1 b4 g7 ?/ G9 D3 `, \# V/ k
- If Not IsEmpty(Vnamearr) Then
4 T$ U$ I1 F. O% S
, m; T c2 Q* L0 z- For Each Vnamearr2 In Vnamearr5 }4 \$ e* F3 O. S9 y6 k. Y) s1 X
- . K% q, X/ v2 k* Y9 {1 S
- bRet = Part.DeleteCustomInfo2(CurCFGname(i), Vnamearr2); m+ q# e# a% w F, L( a, r
- ; {+ g5 E& S4 t0 O. ]8 m; J% O3 i
- Next. |/ W$ T1 d }9 D
% v% c' f3 a9 j6 B" [1 E; U- End If6 b; x1 h; y0 L) k0 z+ j+ x
- ( S5 h) `( L! ?1 d0 @9 n- F8 T9 g
- Next; Y, a# n% `$ S. Y
复制代码
& v6 ?' P5 Q5 S$ p5 O- n# K x! p* ?; j. `4 Z
|