Results 1 to 4 of 4

Thread: Automation Error. UCS X and Y axis aren't perpendicular

  1. #1
    Active Member
    Join Date
    2005-12
    Posts
    72
    Login to Give a bone
    0

    Default Automation Error. UCS X and Y axis aren't perpendicular

    Hi,
    there must be some kind of precision error in calculation of perpendicularity of x and y vectors in vlisp. I get this error when tried to run the code below to add an ucs object to the active document.
    Previously VBA coders came across this error and some of them wrote very tedious and complicated solution routines that I couldn't understand as a lisp programmer.

    Code:
    (defun c:ucc ()
      (setq adoc   (vla-get-activedocument (vlax-get-acad-object)))
      (setq ucsobj (vla-get-usercoordinatesystems adoc))
      (setq origin (vla-getvariable adoc "UCSORG"))
      (setq xdir   (vla-getvariable adoc "UCSXDIR"))
      (setq ydir   (vla-getvariable adoc "UCSYDIR"))
      (setq ucs_current (vla-add ucsobj origin xdir ydir "UCS_Current"))
      )
    any ideas to overcome this error? thanks

  2. #2
    Member
    Join Date
    2009-03
    Posts
    39
    Login to Give a bone
    0

    Default Re: Automation Error. UCS X and Y axis aren't perpendicular

    What I don't know, and I would like it, is why when you draw a 3dline and select that line as UCS, the UCS is not aligned with the line.

  3. #3
    AUGI Addict
    Join Date
    2015-12
    Posts
    2,095
    Login to Give a bone
    0

    Default Re: Automation Error. UCS X and Y axis aren't perpendicular

    The system variables you are getting are unit vectors; I think the UCS collection Add method is expecting WCS points for the x and y directions. Try applying the x/y/z values from the unit vectors as delta's to the origin point, and make sure everything is in WCS.

  4. #4
    Active Member
    Join Date
    2005-12
    Posts
    72
    Login to Give a bone
    0

    Default Re: Automation Error. UCS X and Y axis aren't perpendicular

    thanks dgorsman you made the correct diagnosis for this problem! I tought it would be unit vectors of direction but actually add method was expecting wcs points as you have said. thanks again.

Similar Threads

  1. Replies: 2
    Last Post: 2009-09-17, 01:53 PM
  2. Automation Error Help
    By CADdancer in forum AutoLISP
    Replies: 13
    Last Post: 2009-01-14, 12:38 AM
  3. Replies: 6
    Last Post: 2007-05-02, 11:39 AM
  4. Replies: 7
    Last Post: 2006-11-03, 07:43 PM
  5. Automation error
    By rodmc in forum AutoLISP
    Replies: 1
    Last Post: 2004-08-19, 03:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •