- Dim swApp As Object9 ~; n/ Y) m( |' Z- _, B% z; r
- 1 t0 w( L- z- V/ h `
- Dim Part As Object) h5 i! e% ?1 [! w- C9 P' D4 T @
- Dim boolstatus As Boolean; n9 v' k5 Z! N5 G" K- @6 L- r
- Dim longstatus As Long, longwarnings As Long; B) q# H! c N$ g1 x+ R
7 q9 U8 ^" n: z6 S; T( F# }- Sub main() '删除所有配置属性0 t7 l/ s+ w9 J1 l
4 Y- y f/ _ j; {- Set swApp = Application.SldWorks
( v0 S+ V& a/ C. _ - ) ^6 o, F) \9 m" R( T
- Set Part = swApp.ActiveDoc
+ n4 Z! d% ~2 b, ], E - 7 @8 v6 l" p, U
- CurCFGname = Part.GetConfigurationNames- D* Q7 X$ T7 N, H9 a
- 7 M2 p% Z* P* n* g+ o1 H: h2 F3 G
- CurCFGnameCount = Part.GetConfigurationCount% `8 }# D5 {5 l' {, l& I S% F
3 e* S; y% {; s0 \% N3 G- For i = 0 To CurCFGnameCount - 1
8 Y# N! r9 D! X2 I4 O" s - : b7 y% z* w3 D; `9 D. K: l
- Set CusPropMgr = Part.Extension.CustomPropertyManager(CurCFGname(i))
/ E8 i) p" w4 |' A5 f- Q; g4 c( Z( P - - v1 W M7 V! S0 y/ f I
- Vnamearr = CusPropMgr.GetNames
" j" T+ g# D9 ^0 ~$ _/ m$ m - ! R6 v$ e9 Z( C2 R4 C
- If Not IsEmpty(Vnamearr) Then
- _9 B! K" N* W" I/ D, q+ d
! g+ P0 A0 Z, |- For Each Vnamearr2 In Vnamearr
: m* |, S' F) ~# l/ j% O- J1 m
' k# X# M7 p9 F* ?- bRet = Part.DeleteCustomInfo2(CurCFGname(i), Vnamearr2)3 ?8 y; P( X, p: g9 w- X
9 ?8 Q0 o' o' k3 w9 G9 \) j$ }- Next
; `8 N$ l9 ?0 m& E/ t9 ]) e
$ U" G4 {/ }& ~" S- End If
/ F/ ]6 K8 J# L* T# V: l/ t - ) K" Q& j& z% S" ` [( V! O
- Next
; `2 |, V! Q: b9 w0 O' ?
复制代码
- f2 @2 [% o, \
1 C |/ k( I8 D( B |