Automation Error and vla-get-ActiveUcs

Discussion in 'AutoCAD' started by MRL, Aug 20, 2003.

  1. MRL

    MRL Guest

    Hello,

    When i typ:
    (vla-get-ActiveUCS (vla-get-ActiveDocument (vlax-get-acad-object)))

    I get an error: Automation Error. Error adding object to symbol table

    Has it something to do when i have none ucs saved?


    Martin
     
    MRL, Aug 20, 2003
    #1
  2. MRL

    DonB Guest

    From Help:

    If you try to get the active UCS value when the current UCS is unsaved, an
    error will occur. It is recommended that you confirm that the value of the
    UCSNAME system variable is not empty before you get the active UCS value.
    Alternatively, you can add a new UCS object and set it to active before
    getting the active UCS value.

    HTH

    Don
     
    DonB, Aug 20, 2003
    #2
  3. MRL

    Joe Burke Guest

    Martin,

    This function by Doug Broad returns the UCS matrix named or not.

    ;;D. C. Broad, Jr. - A reworked version
    ;;of Tony T's GetActiveUcsMatrix function.
    ;;That can be used with transformby to
    ;;transform objects from the WCS to the UCS.
    ;;Equivalent to getucsmatrix activeucs but 8 times faster.

    (defun WCS2UCSMatrix ()
    (vlax-tmatrix
    (append
    (mapcar
    '(lambda (vector origin)
    (append (trans vector 0 1 t) (list origin))
    )
    (list '(1 0 0) '(0 1 0) '(0 0 1))
    (trans '(0 0 0) 1 0)
    )
    (list '(0 0 0 1))
    )
    )
    )

    View the matrix:
    (vlax-SafeArray->List (vlax-Variant-Value (WCS2UCSMatrix)))

    You might want the read the thread where it originated. "info re:
    GetUCSMatrix" dated 8/9/2003.

    Joe Burke
     
    Joe Burke, Aug 21, 2003
    #3
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.