Get XVector

Discussion in 'AutoCAD' started by Hilly, Jul 17, 2006.

  1. Hilly

    Hilly Guest

    Hey,

    I'm pretty new to Vba but i'm trying to get the Xvector of a current
    UCS without having to save the UCS. I'm working with 2007 so things
    maybe a bit differant from older versions. I'm as aware of the methods
    in the help menu that will allow me to save the ucs and get the Xvector
    but i don't want to have to save this but instead just return it from
    the current ucs. It seems to be that with 2007 unless the UCS is saved
    it is not reconised as the Active UCS. Can anyone tell me of a method
    that will allow me to retrieve the Xvector of the Active UCS in 2007??

    Private Sub CurrXvector()
    Dim newUCS As AcadUCS
    Dim currUCS As AcadUCS
    Dim origin(0 To 2) As Double
    Dim xAxis(0 To 2) As Double
    Dim yAxis(0 To 2) As Double

    Set currUCS = ThisDrawing.ActiveUCS ''''''''''''''This is the line that
    won't work in 2007

    MsgBox "The current UCS is " & currUCS.Name, vbInformation, "ActiveUCS
    Example"

    ' Display the current setting of the vectors
    MsgBox "The current XVector is: " _
    & currUCS.XVector(0) & ", " & currUCS.XVector(1) & ", " &
    currUCS.XVector(2) & vbCrLf _
    & "The current YVector is: " _
    & currUCS.YVector(0) & ", " & currUCS.YVector(1) & ", " &
    currUCS.YVector(2), , "YVector Example"

    End Sub
     
    Hilly, Jul 17, 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.