- Dim swApp As Object" ]1 v; q6 r0 p0 [3 B
0 ^5 E1 ^/ E3 C! @4 G8 _- Dim Part As Object9 u1 P4 I. c& d/ P- v9 C
- Dim boolstatus As Boolean) `- W( m3 o# b( ?
- Dim longstatus As Long, longwarnings As Long7 j8 h- N6 M) L3 F2 Z
- " v2 x1 B5 t, g$ e0 ]) x' a( p
- Sub main() '删除所有配置属性
j0 r: x$ p4 J1 m8 ]% z - ) I( L0 ^6 s5 w0 L
- Set swApp = Application.SldWorks" ?: J; Z, s' t* d
- ) \: R( Y7 y; U9 z
- Set Part = swApp.ActiveDoc3 }" m% X) R7 K* s3 R d8 `+ ^
- * H) J. f. v/ n& W4 Y; i
- CurCFGname = Part.GetConfigurationNames
/ A) _& u4 X" y2 k3 O$ V4 ?( a - 3 `6 x/ C! U) q# x
- CurCFGnameCount = Part.GetConfigurationCount
* K, b& A7 Q [ - + y: S7 j9 A- J# |- [1 p
- For i = 0 To CurCFGnameCount - 1' o4 y! y/ ?) d' b
1 K5 q; K. y# T; M- [% O3 _) D/ W- Set CusPropMgr = Part.Extension.CustomPropertyManager(CurCFGname(i))9 |2 c6 D* k; S
- / W- ^* L' j, r2 W. ~) n0 T
- Vnamearr = CusPropMgr.GetNames) H% e W% e+ m2 a% m/ j
- 3 Z8 v1 I0 V) K! H5 k( v
- If Not IsEmpty(Vnamearr) Then7 E9 A5 {( H/ P! [
, d& z% `# x( l) a. i5 f- f6 _# w- For Each Vnamearr2 In Vnamearr
8 E4 \% J5 a: x; c# m" M - 3 t$ A4 m1 O, [# Q, _5 N! j4 y
- bRet = Part.DeleteCustomInfo2(CurCFGname(i), Vnamearr2)
3 D" Q1 x# y+ o9 w - + W2 n+ J4 v" S9 j7 Y+ e
- Next
9 s; a+ M2 w/ o: V% v
$ R. t% b" U& Q. D) [- End If' G! [0 }" _+ r! L
- e( R0 ]3 U) L% ?, W% U- Next$ K& V% G' s) f8 E
复制代码
2 }+ x7 J3 H* m. B3 v. e! b. n" Y
|