- Dim swApp As Object9 f3 j) F* \. d; h2 @/ p
- * t, {" a4 U6 z" w
- Dim Part As Object5 J) _$ _! u; H( h1 T3 m8 ]
- Dim boolstatus As Boolean5 Y" f- {# D4 ^8 u: y" I c3 n2 F
- Dim longstatus As Long, longwarnings As Long
6 g% u+ t; |8 ^ - n, p( O& `- S- ?( ^% w9 g& g- q6 J
- Sub main() '删除所有配置属性& e. i, n3 c9 X7 U
- * ?; o7 ?# }# N$ C- H+ T+ Q: _/ u
- Set swApp = Application.SldWorks
& o' G5 Q! |) d+ B0 C9 J' m3 d
A; ]( U2 G6 i5 \+ Y1 z) E- Set Part = swApp.ActiveDoc
$ k0 O6 M& |1 T) f - - n& |4 g* s2 _0 P6 L! U) F) `
- CurCFGname = Part.GetConfigurationNames
1 Y' j7 {& c$ s7 U7 k
7 j* N: g f/ G( B! Q! W4 j- CurCFGnameCount = Part.GetConfigurationCount. x& v5 f* g# | H# [
$ B/ V8 h6 c9 ]- For i = 0 To CurCFGnameCount - 16 ~3 f, n' {8 p3 O1 A' P8 _: Z+ z8 y
) n _% s* |: I- Set CusPropMgr = Part.Extension.CustomPropertyManager(CurCFGname(i))6 M2 ?8 C- _1 L5 W6 G& M: H; r
- , T: A' b* ^& ]# ` X1 O
- Vnamearr = CusPropMgr.GetNames
4 W$ B( k8 k+ j" G( o1 S - h; [ [4 z* }4 ^. @! l
- If Not IsEmpty(Vnamearr) Then
* {+ A- Q0 [2 h& e* e- x3 [
* u+ v% g h, ]3 |( }- For Each Vnamearr2 In Vnamearr
5 ?. r4 [0 {: f! n8 x - ( j( L, n: s# ^
- bRet = Part.DeleteCustomInfo2(CurCFGname(i), Vnamearr2)! p0 `, B& z1 T, F
- A- @0 U) |% r% p7 Z. b) M [- Next
9 c$ h: a2 ]2 E4 b2 y v - $ F9 B- }5 I' M g, O4 @
- End If
! Y8 m# d) V$ _2 _$ Q( L, X2 i+ Y - $ Y7 K1 `5 b" _& U: T- W0 h4 ^( ~
- Next- w4 t! L( H/ w) g& @2 g
复制代码 y" ?; d$ e9 W. ^" Q% t( K$ `3 Y
% T& y: W- Q! S' i; d& _ |