Automation Error and vla-get-ActiveUcs

MRL

Usenet Archive
Joined
Jul 8, 2003
Messages
45
Reaction score
0
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
 
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
 
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
 

Latest threads

Back
Top