Handling UCS and WCS

Discussion in 'AutoCAD' started by Kevin Nehls, Jul 3, 2003.

  1. Kevin Nehls

    Kevin Nehls Guest

    How to you guys handle UCS and WCS? Do you program your routines to just
    work in WCS or do you program to translate all points to one coordinate
    system or the other?

    So far I've only worked in WCS and that's where my programs work. But we've
    ran into a couple of drawings that were set to some odd-ball UCS and the
    programs still worked, but they were either drawing notes 1000s of units
    outside the border or inserting blocks in a completely different location
    than they were suppose to, etc, etc.

    The solution has been to just have my users swtich back to WCS with a simple
    issue of UCS > Enter. For any routine that uses points, should I take the
    extra care and time to translate all points from UCS to WCS or WCS to UCS
    depending on the function?
     
    Kevin Nehls, Jul 3, 2003
    #1
  2. Kevin Nehls

    F. Gump Guest

    I usually consider the UCS when programming.
    Sometimes my programs create a temp UCS, and then issue a "UCS, Previous"
    before they exit.

    I also make use of the TRANS function in lisp.
     
    F. Gump, Jul 3, 2003
    #2
  3. Kevin Nehls

    Kevin Nehls Guest

    Yeah I think I answered my question when answering yours "on the dark side".

    Just never took it into consideration here and I probably should TRANS
    everything into the UCS coordinate system when getting points. Like getting
    the insertion point of a block from the DXF codes returns the OCS point but
    not the UCS point.... So basing an insert off of the OCS could throw
    everything way off if the user isn't in WCS at the time.

    One more thing to add to the list of "fixes/updates/patches/etc/etc/etc"

    Thanks for the feedback
     
    Kevin Nehls, Jul 3, 2003
    #3
  4. Kevin Nehls

    John Uhden Guest

    Mostly via (trans). When I'm lazy, I progamatically switch to WCS and put
    things back when done. But if you do that, then watch out for UCSFOLLOW.
     
    John Uhden, Jul 4, 2003
    #4
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.