home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "modRadDimTie"
- '******************************************************************'
- '* *'
- '* TurboCAD for Windows *'
- '* Copyright (c) 1993 - 2001 *'
- '* International Microcomputer Software, Inc. *'
- '* (IMSI) *'
- '* All rights reserved. *'
- '* *'
- '******************************************************************'
-
- Option Explicit
-
- Sub RadDiaCon()
- Dim ActDr As Drawing
- Dim Grs As Graphics
- Dim Vi As View
- Dim GrDim As Graphic
-
- Set ActDr = ActiveDrawing
- Set Grs = ActDr.Graphics
- Set Vi = ActDr.ActiveView
-
- Dim xCl#, yCl#
- Vi.GetMouseClick xCl, yCl
- Dim PRes As PickResult
- Set PRes = Vi.PickPoint(xCl, yCl)
- Dim PicCount As Long, i As Long
- PicCount = PRes.Count
- If PicCount = 0 Then
- Exit Sub
- End If
- Dim GrType$
- Dim GrDimExist As Boolean
- GrDimExist = False
- For i = 0 To PicCount - 1
- Set GrDim = PRes(i).Graphic
- GrType = GrDim.Type
- If GrType = "TCW25DimRad" Or GrType = "TCW25DimDia" Then
- GrDimExist = True
- Exit For
- End If
- Next i
-
- If GrDimExist = False Then Exit Sub
-
- Dim x1Dim#, y1Dim#
- With GrDim.Vertices
- x1Dim = .Item(1).X
- y1Dim = .Item(1).Y
- End With
- Dim x1DimV#, y1DimV#
- Vi.WorldToView x1Dim, y1Dim, 0, x1DimV, y1DimV, 0
- Set PRes = Vi.PickPoint(x1DimV, y1DimV)
- PicCount = PRes.Count
- If PicCount = 0 Then Exit Sub
-
- Dim GrCon As Graphic
- Dim GrConExist As Boolean
- GrConExist = False
- For i = 0 To PicCount - 1
- Set GrCon = PRes(i).Graphic
- GrType = GrCon.Type
- If GrType = "ARC" Or GrType = "CIRCLE" Or GrType = "TCW50Polyline" Then
- GrConExist = True
- Exit For
- End If
- Next i
-
- If GrConExist = False Then Exit Sub
- Dim TSets As TieSets
- Set TSets = ActDr.TieSets
- TSets.Add "RadDia.DimTie", GrCon, GrDim, 0, 0
-
- End Sub
-