|
经典图书 Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID(“注解”, “DCABINET”, 0,0, 0, False, 0, Nothing)
'打开对应的模型文件
Dim rs As ADODB.Recordset
Dim conn As ADODB.Connection
'定义ADO对象变量好就好中国权威模具网
ss = App.Path & "database"
Set conn = New ADODB.Connection
conn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;" & “Persist Security Info=False;” & “Mode=read;”& “Data Source=” & ss & “模具零件库.mdb;”
c
onn.Open
‘建立ADO连接,打开数据库
newTableName = Str(2011)
A d o d c 1 . R e c o r d S o u r c e =newTableName
Adodc1.Refresh
S e t D a t a G r i d 1 . D a t a S o u r c e =Adodc1
‘打开记录集,读取模具零件型号
DataGrid1.Row = 0好就好中国权威模具网
For i = 1 To DataGrid1.Columns.Count 1
D(i) = DataGrid1.Columns(i).Value
Next
DataGrid1.Row = 1
For i = 1 To DataGrid1.Columns.Count 1
tolMax(i) = DataGrid1.Columns(i).Value
Next
DataGrid1.Row = 2
For i = 1 To DataGrid1.Columns.Count 1
tolMin(i) = DataGrid1.Columns(i).Value
Next
'存入模具零件尺寸值和公差值好就好中国权威模具网
B o o l s t a t u s = P a r t . E x t e n s i o n .SelectByID(“D1@草图1@凸模.SLDPRT”,
“DIMENSION”, 0, 0, 0, False, 0,Nothing)
Part.Parameter(“D1@草图1”).SystemValue = D(1) / 1000
retval = Part.Parameter(“D1@草图1”).SetToleranceValues(tolMin(1) /1000, tolMax(1) / 1000)
‘驱动模具零件尺寸和公差
三、结论
基于S o l i d W o r k s平台的挤压模具CAD系统通过集成大量挤压模设计资料和专家经验,形成了模具设计知识库,为典型挤压零件的模具设计提供了完整的计算机辅助设计手段,甚至连一些缺乏经验的技术人员也能够利用本系统完成挤压模具的设计,从而有利于挤压技术的推广和应用。同时该系统也是对SolidWorks专业化应用的开拓与实践,对其余专业从事SolidWorks本地化专业化的二次开发具有重要借鉴意义。为了使本系统更加完整,目前正在补充模具强度校核部分 |
|