home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1998 November
/
pcwk_11_98a.iso
/
Wtestowe
/
SOFTSRC
/
vtrial15.exe
/
DATA.1
/
List.frm
< prev
next >
Wrap
Text File
|
1997-02-14
|
9KB
|
292 lines
VERSION 4.00
Begin VB.Form ListForm
Caption = "List"
ClientHeight = 3330
ClientLeft = 2145
ClientTop = 2190
ClientWidth = 3990
Height = 3735
Icon = "List.frx":0000
Left = 2085
LinkTopic = "Form1"
ScaleHeight = 3330
ScaleWidth = 3990
Top = 1845
Width = 4110
Begin VB.CommandButton TextCommand
Caption = "Change Text &Height"
Enabled = 0 'False
Height = 375
Left = 1920
TabIndex = 8
Top = 2760
Width = 1815
End
Begin VB.CommandButton PolylineCommand
Caption = "Change Polyline &Width"
Enabled = 0 'False
Height = 375
Left = 1920
TabIndex = 7
Top = 2280
Width = 1815
End
Begin VB.TextBox NumberEntry
Enabled = 0 'False
Height = 285
Left = 240
TabIndex = 6
Text = "1"
Top = 2520
Width = 1575
End
Begin VB.CommandButton PropertiesCommand
Caption = "&Edit Properties"
Enabled = 0 'False
Height = 375
Left = 240
TabIndex = 5
Top = 1680
Width = 2055
End
Begin VB.ListBox EntityList
Height = 1980
Left = 2520
TabIndex = 1
Top = 120
Width = 1215
End
Begin VB.CommandButton ListSelected
Caption = "&List Selected Entities"
Height = 495
Left = 240
TabIndex = 0
Top = 120
Width = 2055
End
Begin VB.Label Info2
Alignment = 2 'Center
Height = 255
Left = 240
TabIndex = 4
Top = 1200
Width = 2055
End
Begin VB.Label Info1
Alignment = 2 'Center
Height = 255
Left = 240
TabIndex = 3
Top = 960
Width = 2055
End
Begin VB.Label EntityName
Alignment = 2 'Center
Height = 255
Left = 240
TabIndex = 2
Top = 720
Width = 2055
End
End
Attribute VB_Name = "ListForm"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
' (C) Copyright 1997 by SoftSource. All rights reserved.
' Sample Visual Basic code for working with Vdraft
'
' This code demonstrates getting various types
' of entity information out of a drawing
Dim vdraft As Object
Dim doc As Object
Private Sub EntityList_Click()
Dim selset, entity, units As Object
PropertiesCommand.Enabled = True
' get the entity they picked
Set selset = doc.Selection
Set entity = selset(EntityList.ListIndex + 1)
' we'll use this to output points in current units
Set units = doc.units
Info1.Caption = ""
Info2.Caption = ""
' display information on specific entity
EntityName.Caption = entity
Select Case entity.Type
Case veET_Line
Info1.Caption = units.PointToString(entity.Where1)
Info2.Caption = units.PointToString(entity.Where2)
Case veET_Point
Info1.Caption = units.PointToString(entity.Where)
Case veET_Circle
Info1.Caption = units.PointToString(entity.Where)
Info1.Caption = units.CoordinateToString(entity.Radius)
Case veET_Shape
Info1.Caption = units.PointToString(entity.Where)
Case veET_Text
Info1.Caption = units.PointToString(entity.Where)
Info2.Caption = entity.Text
Case veET_Arc
Info1.Caption = units.PointToString(entity.Where)
Info2.Caption = units.CoordinateToString(entity.Radius)
Case veET_Trace, veET_Solid
Info1.Caption = entity.Circumference
Info2.Caption = entity.Area
Case veET_Insert
Info1.Caption = units.PointToString(entity.Where)
Info2.Caption = entity.Block
Case veET_Attdef, veET_Attrib
Info1.Caption = units.PointToString(entity.Where)
Info2.Caption = entity.Text
Case veET_2DPolyline
Info1.Caption = entity.Vertices.Count
Info2.Caption = entity.StartWidth
Case veET_3DPolyline
Info1.Caption = entity.Vertices.Count
Case veET_Polymesh
Info1.Caption = entity.ColumnSize
Info2.Caption = entity.RowSize
Case veET_Polyface
Info1.Caption = entity.Vertices.Count
Info2.Caption = entity.FaceVertices.Count
Case veET_2DVertex
Case veET_Vertex
Case veET_FaceVertex
Case veET_3DFace
Info1.Caption = entity.Circumference
Info2.Caption = entity.Area
Case veET_HorizontalDim To veET_OrdinateYDim ' dimensions
Case veET_Viewport
Info1.Caption = units.PointToString(entity.Where)
End Select
End Sub
Private Sub EntityList_DblClick()
Dim selset As Object
Set selset = doc.Selection
' display the property dialog for the
' entity they chose out of the list
selset(EntityList.ListIndex + 1).Dialog
End Sub
Private Sub Form_Load()
WindowOnTop hWnd
End Sub
Private Sub ListSelected_Click()
Dim selset As Object
ListForm.MousePointer = 11 ' hourglass
If vdraft Is Nothing Then
Set vdraft = CreateObject("Vdraft.Application")
End If
If vdraft.Documents.Count = 0 Then
ListForm.MousePointer = 1 ' default
Exit Sub
End If
Set doc = vdraft.ActiveDocument
Set selset = doc.Selection
If Not selset.HasItems Then
ListForm.MousePointer = 1 ' default
Exit Sub
End If
EntityName.Caption = ""
Info1.Caption = ""
Info2.Caption = ""
PropertiesCommand.Enabled = False
PolylineCommand.Enabled = True
TextCommand.Enabled = True
NumberEntry.Enabled = True
' list all the currently selected entities
EntityList.Clear
Number% = selset.Count
For i% = 1 To Number%
EntityList.AddItem selset(i%)
Next i%
ListForm.MousePointer = 1 ' default
End Sub
Private Sub PolylineCommand_Click()
Dim units, selset, entity As Object
ListForm.MousePointer = 11 ' hourglass
' have Vdraft convert the user's string into a number
Set units = doc.units
Value# = units.StringToCoordinate(NumberEntry.Text)
' group all the modifications under one command
' include the width using current drawing units
Set commands = doc.commands
temp$ = "polylines.width " + units.CoordinateToString(Value#)
commands.Group temp$
' find all the 2d polylines in the current selset
' and change their widths
Set selset = doc.Selection
Number% = selset.Count
For i% = 1 To Number%
Set entity = selset(i%)
If entity.Type = 11 Then
entity.StartWidth = Value#
entity.EndWidth = Value#
End If
Next i%
ListForm.MousePointer = 1 ' default
End Sub
Private Sub PropertiesCommand_Click()
Dim selset As Object
Set selset = doc.Selection
' display the property dialog for the
' entity they chose out of the list
selset(EntityList.ListIndex + 1).Dialog
End Sub
Private Sub TextCommand_Click()
Dim units, selset, entity As Object
ListForm.MousePointer = 11 ' hourglass
' have Vdraft convert the user's string into a number
Set units = doc.units
Value# = units.StringToCoordinate(NumberEntry.Text)
' group all the modifications under one command
' include the height using current drawing units
Set commands = doc.commands
temp$ = "textgroup.height " + units.CoordinateToString(Value#)
commands.Group temp$
' find all the text in the current selset
' and change their heights
Set selset = doc.Selection
Number% = selset.Count
For i% = 1 To Number%
Set entity = selset(i%)
If entity.Type = 4 Then
entity.Height = Value#
End If
Next i%
ListForm.MousePointer = 1 ' default
End Sub