- Dim swApp As Object
/ L7 S7 G& t" E2 V/ ^ - 3 s' X5 X& ] n
- Dim Part As Object8 j! X: t+ K! Y/ [
- Dim boolstatus As Boolean
5 k6 v+ p3 P" s- I" h - Dim longstatus As Long, longwarnings As Long
; @1 ~1 u n) D& C
8 c$ c$ z& l7 M5 i/ Y. H- Sub main() '删除所有配置属性
' g0 `+ ?/ K; u# v$ @( Q9 ?# D
) Q9 ]/ [9 w. g+ A. g4 @' W- Set swApp = Application.SldWorks
$ ]6 D P: n6 l1 Q - & F) j# `/ L) q( t% ?
- Set Part = swApp.ActiveDoc6 B- _, X- O6 L. L% ^" K/ Z3 u4 i
- 1 G- u4 p* X7 }, d4 o4 L2 [
- CurCFGname = Part.GetConfigurationNames- a+ K* o1 E: T, z9 D9 R) }7 ?3 S
' [$ s1 X% ]# l, t) s- CurCFGnameCount = Part.GetConfigurationCount
3 e6 i; s& [ v8 t/ K9 Z - 5 T4 C( |5 U2 ?2 j7 F+ O
- For i = 0 To CurCFGnameCount - 1
8 @5 W# [8 o% ~/ J) @
1 r. f. K. u! z {- Set CusPropMgr = Part.Extension.CustomPropertyManager(CurCFGname(i))
8 e9 A ^, T5 V0 w/ w! O - % Q% A2 z T; j
- Vnamearr = CusPropMgr.GetNames
0 x4 g0 V' R! H4 [
3 r" g# ^6 I3 v, _5 c8 \8 A7 g- If Not IsEmpty(Vnamearr) Then
% H8 c4 j# ]$ c* g% u, p0 | - * U( ~: o7 n8 B9 V. P0 _
- For Each Vnamearr2 In Vnamearr5 k# w* _6 X$ q0 @9 \( o
6 X9 j, |' w) ^- bRet = Part.DeleteCustomInfo2(CurCFGname(i), Vnamearr2)
% U$ ]0 h/ W) Z; @# R - & G; q3 ?7 B; S" u
- Next
0 b/ U( n7 r8 C' y; d, c4 ] - * a, ~" h$ m$ G% H: S
- End If
k3 I7 {! S# }& |% o) ?
3 o1 Z- A- X3 q! d" b4 v- Next" y; g# S1 z$ {; T+ n
复制代码
6 t7 x% `8 @! a; {: Z2 j
+ C% }6 @# x$ u |