home *** CD-ROM | disk | FTP | other *** search
/ The Houseplan Collection / HRCD2005.ISO / data1.cab / Zusatz / 3DS / DATA2.Z / Selektionsdemo.frm < prev    next >
Text File  |  1999-08-19  |  4KB  |  153 lines

  1. VERSION 5.00
  2. Begin VB.Form Selektionsdemo 
  3.    Caption         =   "Objekte selektieren"
  4.    ClientHeight    =   2760
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   6630
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   2760
  10.    ScaleWidth      =   6630
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.Frame Frame1 
  13.       Caption         =   "Zuletzt selektiertes Objekt:"
  14.       Height          =   2535
  15.       Left            =   2280
  16.       TabIndex        =   4
  17.       Top             =   120
  18.       Width           =   4215
  19.       Begin VB.TextBox RoomName 
  20.          Height          =   375
  21.          Left            =   120
  22.          TabIndex        =   8
  23.          Top             =   1680
  24.          Width           =   3975
  25.       End
  26.       Begin VB.TextBox ObjName 
  27.          Height          =   375
  28.          Left            =   120
  29.          TabIndex        =   6
  30.          Top             =   600
  31.          Width           =   3975
  32.       End
  33.       Begin VB.Label Label2 
  34.          Caption         =   "Befindet sich in Raum:"
  35.          Height          =   255
  36.          Left            =   120
  37.          TabIndex        =   7
  38.          Top             =   1320
  39.          Width           =   1815
  40.       End
  41.       Begin VB.Label Label1 
  42.          Caption         =   "Name:"
  43.          Height          =   255
  44.          Left            =   120
  45.          TabIndex        =   5
  46.          Top             =   360
  47.          Width           =   855
  48.       End
  49.    End
  50.    Begin VB.CommandButton Quit 
  51.       Caption         =   "Ende"
  52.       Height          =   375
  53.       Left            =   240
  54.       TabIndex        =   3
  55.       Top             =   2280
  56.       Width           =   1695
  57.    End
  58.    Begin VB.CommandButton Delete 
  59.       Caption         =   "Selektierte l÷schen"
  60.       Height          =   375
  61.       Left            =   240
  62.       TabIndex        =   2
  63.       Top             =   1440
  64.       Width           =   1695
  65.    End
  66.    Begin VB.CommandButton ClearSel 
  67.       Caption         =   "Alle deselektieren"
  68.       Height          =   375
  69.       Left            =   240
  70.       TabIndex        =   1
  71.       Top             =   840
  72.       Width           =   1695
  73.    End
  74.    Begin VB.CommandButton SelAll 
  75.       Caption         =   "Alle selektieren"
  76.       Height          =   375
  77.       Left            =   240
  78.       TabIndex        =   0
  79.       Top             =   240
  80.       Width           =   1695
  81.    End
  82. End
  83. Attribute VB_Name = "Selektionsdemo"
  84. Attribute VB_GlobalNameSpace = False
  85. Attribute VB_Creatable = False
  86. Attribute VB_PredeclaredId = True
  87. Attribute VB_Exposed = False
  88. Option Explicit
  89.  
  90. Dim WithEvents exe As ArCon.ArCon
  91. Attribute exe.VB_VarHelpID = -1
  92.  
  93. Private Sub ClearSel_Click()
  94.     exe.Clear3DObjectSelection
  95. End Sub
  96.  
  97. Private Sub Delete_Click()
  98.     Dim a, lb As Long, ub As Long, i As Long
  99.     Dim o As ArCon.Object3D
  100.     a = exe.Selected3DObjects
  101.     lb = LBound(a)
  102.     ub = UBound(a)
  103.     If MsgBox("M÷chten Sie wirklich " & ub - lb + 1 & " Objekte l÷schen?", vbYesNo) = vbYes Then
  104.         exe.MultiUserMode = 0
  105.         For i = lb To ub
  106.             Set o = a(i)
  107.             o.Delete True
  108.         Next
  109.         exe.MultiUserMode = ACMU_DEFAULT
  110.     End If
  111. End Sub
  112.  
  113. Private Sub exe_ChangeNotify(ByVal obj As Object, ByVal events As Long)
  114.     If events And AC_CHANGE_Selection Then
  115.         Dim o As ArCon.Object3D
  116.         Set o = obj
  117.         If o.IsSelected Then
  118.             ObjName.Text = o.Name
  119.             RoomName.Text = o.Room(1).Name
  120.         End If
  121.     End If
  122. End Sub
  123.  
  124. Private Sub exe_ProgramExit()
  125.     Set exe = Nothing
  126.     Unload Me
  127. End Sub
  128.  
  129. Private Sub Form_Load()
  130.     Set exe = New ArCon.ArCon
  131.     exe.StartMe hWnd, ""
  132.        
  133.     Dim obj As ArCon.Object3D
  134.     For Each obj In exe.DesignObjects
  135.         exe.NotifyOnChange obj, AC_CHANGE_Selection
  136.     Next
  137. End Sub
  138.  
  139. Private Sub Form_Unload(Cancel As Integer)
  140.     If Not exe Is Nothing Then
  141.         exe.EndMe
  142.         Set exe = Nothing
  143.     End If
  144. End Sub
  145.  
  146. Private Sub Quit_Click()
  147.     Unload Me
  148. End Sub
  149.  
  150. Private Sub SelAll_Click()
  151.     exe.SelectAll3DObjects
  152. End Sub
  153.