home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "modPropSel"
- '******************************************************************'
- '* *'
- '* TurboCAD for Windows *'
- '* Copyright (c) 1993 - 2001 *'
- '* International Microcomputer Software, Inc. *'
- '* (IMSI) *'
- '* All rights reserved. *'
- '* *'
- '******************************************************************'
-
- ' This Sample allows to select some object of the activeDrawing
- ' gets its properties and changes any property
-
-
- Public GrSel As Graphic
- Public Vi As View
- Public Color As Long
-
-
-
- Public Sub PickProp()
-
- Dim App As Application
- Dim ActDr As Drawing
- Dim Grs As Graphics
- Dim GrsSelected As Selection
- Dim Vis As Views
- Set App = IMSIGX.Application 'returns the application - TurboCAD
- Set ActDr = App.ActiveDrawing ' returns active dtawing
- Set Grs = ActDr.Graphics ' returns graphics collection
- Set Vis = ActDr.Views 'returns Views collection
- Set Vi = Vis.Item(0) ' returns some view
- Dim xClick#, yClick#
- Dim PicRes As PickResult
- Dim PicEnt As PickEntry
- MsgBox ("Select graphic")
- Vi.GetMouseClick xClick, yClick 'this function gets coordinates of the mouse click
- Set PicRes = Vi.PickPoint(xClick, yClick, 0.1, False, True, True, True, True, False)
- If PicRes.Count = 0 Then Exit Sub
-
- Dim SelCount As Long
- Dim ItemSel As Long
- Dim NameSel As String
- Dim PropCount As Long
- Dim ItemProp As Long
- Dim NameProp As String
- Dim ValueProp As Variant
-
- Set GrSel = PicRes.Item(0).Graphic ' gets selected graphic
- PropCount = GrSel.Properties.Count ' defines the count of the properties for selected graphic
- For ItemProp = 0 To PropCount - 1
- NameProp = GrSel.Properties.Item(ItemProp).Name
- frmPropSel.GrPropName.AddItem (NameProp)
- Next ItemProp
- frmPropSel.GrPropName.ListIndex = 1
- Vi.Refresh
-
- frmPropSel.Show
-
- End Sub
-