- Dim swApp As Object
6 S: J$ D' m1 r9 a8 c' [ - 5 b$ ~; k/ I% i J5 s
- Dim Part As Object1 T$ p4 w+ M4 A' ]
- Dim boolstatus As Boolean
$ U9 y* I( k5 H o - Dim longstatus As Long, longwarnings As Long
' D M0 y" D, z: W' l( B - ' o$ d6 o5 m) x4 |
- Sub main() '删除所有配置属性
* I$ R/ ` ~) w, A8 t - + ^" S4 C5 d& n$ Q. c: o+ x
- Set swApp = Application.SldWorks
# o8 @( ?! J- C" r, d
c6 @7 C# `6 _; H# n8 e/ T- Set Part = swApp.ActiveDoc. A9 [* G5 g" w2 j! @# N- M
- " x, k( I& W' H
- CurCFGname = Part.GetConfigurationNames; s! l+ {, A( V/ b- a( Z
- / L1 G5 v( l% a
- CurCFGnameCount = Part.GetConfigurationCount
3 Y' I- G/ M: o4 V7 R2 ^8 A - ) K$ o+ ^- {' v6 [
- For i = 0 To CurCFGnameCount - 17 q. m& r1 h' d+ V" Y
! H0 Y3 I/ E! J% @8 k! {; v; H) d- Set CusPropMgr = Part.Extension.CustomPropertyManager(CurCFGname(i))
a3 d2 ~' @* p$ r) |3 y
: m4 C# f/ u: `4 Q- Vnamearr = CusPropMgr.GetNames5 i8 p2 G8 s6 o0 o
3 [9 [: B) Z8 t! W% p0 P- If Not IsEmpty(Vnamearr) Then
6 p2 p" |9 v H: A- t
t! ?- D. r2 C7 d- For Each Vnamearr2 In Vnamearr
0 T. y/ G' ]+ D" u1 y - : i7 f: p5 b: Q7 n" v: Y! g) W
- bRet = Part.DeleteCustomInfo2(CurCFGname(i), Vnamearr2)8 ^, {% t1 U$ c: f0 z
. G& v/ E- @( Z0 {- Next
# h5 Y% E& _/ V# n" e - ( y3 r0 `' `! u" g% \
- End If* Y6 h v' X, G2 X) `4 [
. @6 W; n' U: G9 J- Next
9 ]' ]3 @/ E& M+ ?% r# k
复制代码 ) g) p; Y g. r
- I8 P$ D0 Z, S
|