Zoom out problem

Discussion in 'AutoCAD' started by Bekir, Oct 26, 2006.

  1. Bekir

    Bekir Guest

    Hello,

    i have a drawing which has a project no (Text) and its value offsetted
    and drawn (1450) . I want to make a report of project values. However,
    the code given below does not work when i zoom out, it works fine in
    one zoom setting, however when i zoom out, it selects a different text
    object. The strange thing is that even though Y(point(1) ) coordinate
    is fixed, it selects other text, changing about 100/200/etc. units.
    (There are other values in the drawing, like a table). It is really
    strange that even though i dont give any offset values and use the same
    values of (scanTextObj.InsertionPoint), it doesnt select Project No
    again. I have tried other selection methods crossing and window but it
    does not work.

    How can i solve this? I am going crazy :)

    Thanks in advance and any pointer would really be appreciated

    Bekir.


    Public Sub scanProjectNames()

    Dim scanSS As AcadSelectionSet
    Dim scanSSTemp As AcadSelectionSet
    Dim strOpt As String
    Dim FilterType(0) As Integer
    Dim TxtFilterData(0) As Variant

    Dim scanTextObj As AcadText
    Dim scanTmpTxtObj As AcadText


    Dim i As Integer
    Dim j As Integer

    Dim t As Integer
    Dim scanTmpAntet

    Dim bd As Variant
    Dim tu As Variant

    On Error GoTo Done
    With ThisDrawing.Utility

    FilterType(0) = 0
    TxtFilterData(0) = "Text"


    Set scanSS = ThisDrawing.SelectionSets.Add("SCANSS5")
    Set scanSSTemp = ThisDrawing.SelectionSets.Add("SCANSSTEMP5")


    scanSS.SelectOnScreen FilterType, TxtFilterData


    For i = 0 To scanSS.Count - 1

    Set scanTextObj = scanSS(i)

    If (UCase(scanTextObj.TextString) = "PROJECT NO") Then
    '' highlight the selected entities
    'scanSS.Highlight True
    'scanTextObj.Highlight True


    Dim point(0 To 2) As Double

    point(0) = scanTextObj.InsertionPoint(0) + 1450 '
    Offset for project value
    point(1) = scanTextObj.InsertionPoint(1)
    point(2) = scanTextObj.InsertionPoint(2)


    scanSSTemp.SelectAtPoint point, FilterType, TxtFilterData

    If (scanSSTemp.Count > 0) Then

    Set scanTmpTxtObj = scanSSTemp(0)
    .Prompt vbLf & scanTmpTxtObj.TextString
    End If

    scanSSTemp.Clear


    End If


    '.Prompt scanTextObj.TextString

    Next i

    .Prompt vbLf & antets.Count


    End With

    Done:
    '' if the selectionset was created, delete it
    If Not scanSS Is Nothing Then
    scanSS.Delete

    End If

    If Not scanSSTemp Is Nothing Then

    scanSSTemp.Delete

    End If

    End Sub
     
    Bekir, Oct 26, 2006
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.