iCAx开思工具箱

标题: 【原创】 [原创]一个实例(VB)   [打印本页]

作者: 玲玲零零    时间: 2003-1-5 14:42
标题: 【原创】 [原创]一个实例(VB)  
分分分分分分
Private Sub Text1_keyPress(keyp As Integer)  
  
Dim a As String  
Dim swApp As Object  
Dim Part As Object  
Dim boolstatus As Boolean  
Dim longstatus As Long  
Dim Annotation As Object  
Dim Gtol As Object  
Dim DatumTag As Object  
Dim FeatureData As Object  
Dim Feature As Object  
Dim Component As Object  
  
  If keyp = 13 Then  
  a = Text1.Text  
  End If  
  
Set swApp = CreateObject("SldWorks.Application")  
Set Part = swApp.Newpart()  
Set Part = swApp.ActiveDoc  
  
boolstatus = Part.Extension.SelectByID("前视", "LANE", 0, 0, 0, False, 0, Nothing)  
Part.InsertSketch2 True  
Part.ClearSelection  
Part.InsertSketchText 0, 0, 0, "恭喜您" & Chr(13) & Chr(10) & a, 0, 0, 0, 100, 100  
Part.ClearSelection  
boolstatus = Part.Extension.SelectByID("SketchText1", "SKETCHTEXT", 0, 0, 0, False, 0, Nothing)  
Part.FeatureManager.FeatureExtrusion True, False, False, 0, 0, 0.0005, 0.0005, False, False, False, False, 0.01745329251994, 0.01745329251994, False, False, False, False, 1, 1, 1  
  
Part.SelectedFeatureProperties 255, 1, 0.79, 0.88, 0.21, 0, 0.21, 0, 0, "拉伸1"  
  
Part.SelectionManager.EnableContourSelection = 0  
  
Part.ClearSelection  
boolstatus = Part.Extension.SelectByID("点1@原点", "EXTSKETCHPOINT", 0, 0, 0, False, 0, Nothing)  
Part.BlankSketch  
Part.ShowNamedView2 "*等轴测", 7  
Part.ViewZoomtofit2  
  
End Sub




欢迎光临 iCAx开思工具箱 (https://t.icax.org/) Powered by Discuz! X3.3