form1.frm

来自「CATIA二次开发」· FRM 代码 · 共 84 行

FRM
84
字号
VERSION 5.00
Begin VB.Form Form1 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Insert Bolts"
   ClientHeight    =   4185
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4905
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4185
   ScaleWidth      =   4905
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton cmdExit 
      Caption         =   "退出(&X)"
      Height          =   465
      Left            =   3600
      TabIndex        =   1
      Top             =   3600
      Width           =   1215
   End
   Begin VB.CommandButton cmdCreate 
      Caption         =   "插入螺栓(&C)"
      Height          =   465
      Left            =   2100
      TabIndex        =   0
      Top             =   3600
      Width           =   1215
   End
   Begin VB.Image Image1 
      Height          =   3435
      Left            =   0
      Picture         =   "Form1.frx":0000
      Top             =   0
      Width           =   4905
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

' ***********************************************************************
'   目的:      插入15mm螺栓
' ***********************************************************************
Private Sub cmdCreate_Click()
    
    '首先隐藏程序窗口以利观察
    Me.Hide
    
    '新建产品文档,插入组件
    InitCATIAProduct
    InsertPlate
    
    '打开plate.CATPart零件文档,寻找零件中的孔特征
    InitCATIAPart False, App.Path + "\plate.CATPart"
    FindHoles
    
    '激产品文档,装配螺栓到相应的孔位
    oProductDoc.Activate
    AddConstraint
    
    '缩入文档窗口以利观察
    CATIA.ActiveWindow.ActiveViewer.Reframe
    
    '重新显示程序窗口
    Me.Show

End Sub

Private Sub cmdExit_Click()
    Unload Me
End Sub

Private Sub Form_Load()
    MakeMeOnTop Me.hwnd
    Me.Move Screen.Width - Me.Width - 1000, Screen.Height - Me.Height - 1000
    Me.Show
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?