home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2002 March / PCWMAR02.iso / software / turbocad / v8trial / TurboCADv8ProfessionalNoReg.exe / Data.Cab / F41707_modPropSel.bas < prev    next >
Encoding:
BASIC Source File  |  2001-10-16  |  2.1 KB  |  62 lines

  1. Attribute VB_Name = "modPropSel"
  2. '******************************************************************'
  3. '*                                                                *'
  4. '*                      TurboCAD for Windows                      *'
  5. '*                   Copyright (c) 1993 - 2001                    *'
  6. '*             International Microcomputer Software, Inc.         *'
  7. '*                            (IMSI)                              *'
  8. '*                      All rights reserved.                      *'
  9. '*                                                                *'
  10. '******************************************************************'
  11.  
  12. ' This Sample allows to select some object of the activeDrawing
  13. ' gets its properties and changes any property
  14.  
  15.  
  16. Public GrSel As Graphic
  17. Public Vi As View
  18. Public Color As Long
  19.  
  20.  
  21.  
  22. Public Sub PickProp()
  23.  
  24. Dim App As Application
  25. Dim ActDr As Drawing
  26. Dim Grs As Graphics
  27. Dim GrsSelected As Selection
  28. Dim Vis As Views
  29.     Set App = IMSIGX.Application 'returns the application - TurboCAD
  30.     Set ActDr = App.ActiveDrawing ' returns active dtawing
  31.     Set Grs = ActDr.Graphics ' returns graphics collection
  32.     Set Vis = ActDr.Views 'returns Views collection
  33.     Set Vi = Vis.Item(0) ' returns some view
  34. Dim xClick#, yClick#
  35. Dim PicRes As PickResult
  36. Dim PicEnt As PickEntry
  37. MsgBox ("Select graphic")
  38.     Vi.GetMouseClick xClick, yClick 'this function gets coordinates of the mouse click
  39.     Set PicRes = Vi.PickPoint(xClick, yClick, 0.1, False, True, True, True, True, False)
  40.     If PicRes.Count = 0 Then Exit Sub
  41.     
  42. Dim SelCount As Long
  43. Dim ItemSel As Long
  44. Dim NameSel As String
  45. Dim PropCount As Long
  46. Dim ItemProp As Long
  47. Dim NameProp As String
  48. Dim ValueProp As Variant
  49.  
  50.     Set GrSel = PicRes.Item(0).Graphic ' gets selected graphic
  51.     PropCount = GrSel.Properties.Count ' defines the count of the properties for selected graphic
  52.     For ItemProp = 0 To PropCount - 1
  53.         NameProp = GrSel.Properties.Item(ItemProp).Name
  54.         frmPropSel.GrPropName.AddItem (NameProp)
  55.     Next ItemProp
  56.     frmPropSel.GrPropName.ListIndex = 1
  57.     Vi.Refresh
  58.     
  59.     frmPropSel.Show
  60.  
  61. End Sub
  62.