- Dim swApp As Object
1 J: `: ^9 H# ^6 X7 \& q, J* k
9 M+ l1 D$ q% F( \- Dim Part As Object
# p4 U6 A3 {% u( o! t" Z6 X - Dim boolstatus As Boolean
7 u! g$ b- h/ y- O0 S }% l - Dim longstatus As Long, longwarnings As Long5 ` d6 q% M" I/ `/ N
3 p; s( o: M8 H) Z- Sub main() '删除所有配置属性# l0 a- Z: S* D: M! p9 A
' n2 Y. H$ q5 W |- Set swApp = Application.SldWorks
/ S8 \/ G6 E4 c0 c6 C8 L' ^ - " n4 E! R. E0 Y. J2 [; B8 d
- Set Part = swApp.ActiveDoc
9 v3 G# A& D7 H - " m3 v6 r4 f; r
- CurCFGname = Part.GetConfigurationNames
) z6 ^$ D4 L" e" F- f
# t3 }" R( f" r- CurCFGnameCount = Part.GetConfigurationCount
7 Q0 n. E8 s6 p- e8 x
8 T# B, r p# }" n6 c& j: a- For i = 0 To CurCFGnameCount - 1+ u8 ]: Z+ N! z8 W8 U
- 0 H K( }/ [) c& t/ J
- Set CusPropMgr = Part.Extension.CustomPropertyManager(CurCFGname(i))9 K$ @3 H7 R: X7 {; u2 A: [
- ( |* M M. G* Z% ^+ r& r) ~
- Vnamearr = CusPropMgr.GetNames8 I* ~8 H* @6 f2 V2 k: D+ a* o! C
# n% j2 v, ~& e$ H# n3 ?- If Not IsEmpty(Vnamearr) Then
% }& B* p+ \# Y' z
& n# n% L, Z% [: Z9 J+ X8 q: u [- For Each Vnamearr2 In Vnamearr
" V$ D D6 `% V$ o S! S. E1 X - & |; c/ S0 a9 B& ? I, {" j' j- K
- bRet = Part.DeleteCustomInfo2(CurCFGname(i), Vnamearr2)8 R, H9 X% @7 s: J8 w) R
6 F8 I5 L3 x7 u) E( p" D, _- Next4 T$ j& e2 m# B6 q' @- [
2 k- C9 F+ N/ c% Q' P- End If
! \* c& q# F: a% }/ L! K- q
- S- y3 W+ i* ~9 ?# E9 q; M- Next
+ Q! b/ r# `; j; K9 J) ?: h" u* a
复制代码 4 o5 W. u- [8 {' c: V) w
+ W- k0 Z! N2 K$ c- x- w2 M5 m! X
|