⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 CATIA二次开发
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   BackColor       =   &H00D0F0FF&
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "多重截面拉伸功能"
   ClientHeight    =   2970
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   3525
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2970
   ScaleWidth      =   3525
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  '窗口缺省
   WhatsThisButton =   -1  'True
   WhatsThisHelp   =   -1  'True
   Begin VB.CommandButton cmdReverseDir 
      Caption         =   "反方向(&R)"
      Height          =   315
      Left            =   240
      TabIndex        =   14
      Top             =   2040
      Width           =   1455
   End
   Begin VB.CommandButton cmdSelDir 
      Height          =   300
      Left            =   2940
      MaskColor       =   &H00FFFFFF&
      Picture         =   "Form1.frx":0000
      Style           =   1  'Graphical
      TabIndex        =   13
      Top             =   480
      Width           =   300
   End
   Begin VB.CommandButton cmdSelProfile 
      Height          =   300
      Left            =   2940
      MaskColor       =   &H00FFFFFF&
      Picture         =   "Form1.frx":0392
      Style           =   1  'Graphical
      TabIndex        =   12
      Top             =   120
      Width           =   300
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00D0F0FF&
      Caption         =   "拉伸长度(毫米):"
      Height          =   1155
      Left            =   240
      TabIndex        =   9
      Top             =   840
      Width           =   3015
      Begin VB.TextBox txtLimit2 
         Alignment       =   2  'Center
         Height          =   315
         Left            =   960
         TabIndex        =   1
         Text            =   "0"
         Top             =   720
         Width           =   1875
      End
      Begin VB.TextBox txtLimit1 
         Alignment       =   2  'Center
         Height          =   315
         Left            =   960
         TabIndex        =   0
         Text            =   "20"
         Top             =   300
         Width           =   1875
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "负方向:"
         Height          =   180
         Left            =   180
         TabIndex        =   11
         Top             =   780
         Width           =   720
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "正方向:"
         Height          =   180
         Left            =   180
         TabIndex        =   10
         Top             =   360
         Width           =   720
      End
   End
   Begin VB.CommandButton cmdPreview 
      Caption         =   "预览(&P)"
      Default         =   -1  'True
      Enabled         =   0   'False
      Height          =   375
      Left            =   2340
      TabIndex        =   4
      Top             =   2460
      Width           =   1035
   End
   Begin VB.CommandButton cmdExit 
      Caption         =   "取消(&C)"
      Height          =   375
      Left            =   1260
      TabIndex        =   3
      Top             =   2460
      Width           =   1035
   End
   Begin VB.CommandButton cmdComfirm 
      Caption         =   "确定(&O)"
      Enabled         =   0   'False
      Height          =   375
      Left            =   180
      TabIndex        =   2
      Top             =   2460
      Width           =   1035
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "拉伸方向:"
      Height          =   315
      Left            =   300
      TabIndex        =   8
      Top             =   540
      Width           =   1275
   End
   Begin VB.Label lblDir 
      Alignment       =   2  'Center
      BackColor       =   &H00FFFFFF&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "未选择"
      Height          =   315
      Left            =   1260
      TabIndex        =   7
      Top             =   480
      Width           =   1695
   End
   Begin VB.Label lblProfile 
      Alignment       =   2  'Center
      BackColor       =   &H80000005&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "未选择"
      ForeColor       =   &H80000008&
      Height          =   315
      Left            =   1260
      TabIndex        =   6
      Top             =   120
      Width           =   1695
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "参考截面:"
      Height          =   180
      Left            =   300
      TabIndex        =   5
      Top             =   180
      Width           =   900
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

'确定按钮
Private Sub cmdComfirm_Click()
    
    DoExtrude
    Unload Me
    
End Sub

'退出按钮
Private Sub cmdExit_Click()

    Unload Me

End Sub

'预览按钮
Private Sub cmdPreview_Click()
    DoPreview
End Sub

'反方向按钮
Private Sub cmdReverseDir_Click()
    bReverseDir = Not bReverseDir
    DoPreview
End Sub

'选择拉伸方向按钮
Private Sub cmdSelDir_Click()
    
    lblDir.BackColor = &H8000000D
    lblDir.ForeColor = &H8000000E
    lblProfile.BackColor = &H8000000E
    lblProfile.ForeColor = &H8000000D
    
    SelDir
    SetStatus
    
End Sub

'选择参考截面按钮
Private Sub cmdSelProfile_Click()
    
    lblProfile.BackColor = &H8000000D
    lblProfile.ForeColor = &H8000000E
    lblDir.BackColor = &H8000000E
    lblDir.ForeColor = &H8000000D
    
    SelProfile
    SetStatus
    
End Sub

Private Sub Form_Load()
    
    MakeMeOnTop Me.hwnd
    Me.Move Screen.Width - Me.Width - 1000, Screen.Height - Me.Height - 1000
    Me.Show
    
    txtLimit1.SetFocus
    InitCATIAPart False

End Sub

Private Sub Form_Unload(Cancel As Integer)
    DelPreview
End Sub

Private Sub lblDir_Click()
    cmdSelDir_Click
End Sub

Private Sub lblProfile_Click()
    cmdSelProfile_Click
End Sub

Private Sub txtLength1_GotFocus()
    txtLimit1.SelStart = 0
    txtLimit1.SelLength = Len(txtLimit1.Text)
End Sub

Private Sub txtLength2_GotFocus()
    txtLimit2.SelStart = 0
    txtLimit2.SelLength = Len(txtLimit2.Text)
End Sub

'设定界面元素状态
Sub SetStatus()
    
    If ProfileCount > 0 Then
        lblProfile.Caption = ProfileCount & "个元素已选中"
    End If
    If Not (DirElement Is Nothing) Then
        lblDir.Caption = DirElement.Name
    End If
    
    If ProfileCount > 0 And Not (DirElement Is Nothing) Then
        cmdComfirm.Enabled = True
        cmdPreview.Enabled = True
        DoPreview
    End If
    
End Sub

⌨️ 快捷键说明

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