text & insertionpoint problem

Discussion in 'AutoCAD' started by fischer, Sep 23, 2004.

  1. fischer

    fischer Guest

    hola

    i got a code that selects the object in a acadfile then filters the "text"
    objects. then i want to find out the insertion point of this text objects.

    acadtext.insertionpoint is fine when u create a new text by using a code
    that creates actext.

    when i filter the same objects with "actext" i got nothing. i thought it has
    to be the same with "text".


    Sub exportdata()

    Dim sset As AcadSelectionSet
    Dim filtertype(0) As Integer
    Dim filtervalue(0) As Variant
    Dim yazi As String
    Dim boy() As String
    Dim nokta As Variant



    On Error Resume Next
    ThisDrawing.SelectionSets.Item("data").Delete
    Set sset = ThisDrawing.SelectionSets.Add("data")

    filtertype(0) = 0
    filtervalue(0) = "text"
    sset.SelectOnScreen filtertype, filtervalue
    say = sset.Count
    For i = 1 To say - 1
    yazi = sset.Item(i).TextString
    boy = Split(yazi, , , vbTextCompare)
    nokta = sset.Item(i).InsertionPoint
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Next i

    End Sub

    when i try to print.debug nokta(i) i get nothing.

    where is the mistake?

    anyone can help

    thnx.
     
    fischer, Sep 23, 2004
    #1
  2. fischer

    Ed Jobe Guest

    An insertion point is a 3d point, which is an array of 3 doubles. You can't
    just print an array, you have to print each item at each index. You are
    trying to print nokta(i), but what value does i have? The x,y,z coords will
    always be at 0,1,2. Thus:
    Debug.Print nokta(0): Debug.Print nokta(1): Debug.Print nokta(2)

    BTW, you didn't dim "say". If you always include "Option Explicit" in your
    modules Declaration, the ide will alert you to this error. If you have
    "Options>Editor tab>Require Variable Declaration" checked, the option will
    be added when you create a new module.
     
    Ed Jobe, Sep 23, 2004
    #2
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.