|
|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
我是一个很菜的菜鸟,不知道怎么处理代码,忘大神们出来帮忙改好,谢谢!, [. @+ @# \1 ]: m1 { e8 T
代码如下:( c3 [$ P5 \# R. N$ o% u
Dim swApp As SldWorks.SldWorks" M1 M- m( _1 M/ k& {* G: r- E1 [
Dim swModel As SldWorks.ModelDoc
9 |9 \6 t( j! K9 |Dim Part As Object
1 S' M- H3 B; x, u" Z7 P/ nDim swCustPropMgr As SldWorks.CustomPropertyManager \0 C# C7 J+ d1 \# I
2 A( @9 o9 f0 z0 I5 D1 OSub main()
, O% @4 f8 R' h- KSet swApp = Application.SldWorks
! o& ], h, k4 n: b6 aSet swModel = swApp.ActiveDoc
3 \$ a* Z1 u% nSet Part = swApp.ActiveDoc! X3 d m" _8 F9 J* g
Set SelMgr = Part.SelectionManager
7 }, h' q' |0 n7 g! g9 i' _swApp.ActiveDoc.ActiveView.FrameState = 1
0 `9 Y% d0 U; U1 } @Value = Part.GetActiveConfigurationValue("", "Material") '这无法获取成功6 g% c, {. L! k! r* S8 c# @
'Value = Part.GetCustomInfoValue("", "Material") R- s& i3 m5 O, R
If Value = "304" Then
% D& v2 Q4 C( Z! }+ i Z% B# o Set swCustPropMgr = swModel.Extension.CustomPropertyManager(swModel.ConfigurationManager.ActiveConfiguration.Name)
C! @; y" o! E+ A, E swCustPropMgr.Delete ("表面处理") $ Q6 M- N* \7 n& n2 Y
swCustPropMgr.Add2 "表面处理", swCustomInfoText, "抛光"
/ P2 I2 k6 ?6 a) `3 Q& i End If
6 [9 c! C4 _7 t6 fEnd Sub9 h" L% c- t% C4 c& }
" @/ ~! t, k! x5 E6 ? F- |% I% V; w) W* S1 }
! Z' s5 h3 m3 k# o8 s
|
|