UCS, how to find existing saved names?

Discussion in 'AutoCAD' started by W. Kirk Crawford, Feb 3, 2004.

  1. I discovered that I needed to change the UCS.

    So; (command "UCS" "s" "TEMP")
    (command "UCS" "n" "v")
    (do something)
    (command "UCS" "r" "TEMP") now that works.

    But if I have to I have to rerun the routine again, UCS "TEMP" already
    exists. Replace it? <N>

    Where to find the list of names of saved UCSs?

    W. Kirk Crawford
    Rochester Hills, Michigan
     
    W. Kirk Crawford, Feb 3, 2004
    #1
  2. W. Kirk Crawford

    John Uhden Guest

    I think (tblsearch "UCS" <name>) would tell you if <name>exists.

    For a complete list of saved UCS names, you could use the old way...
    (defun UCSNames ( / UCS Names)
    (while (setq UCS (tblnext "UCS" (not Names)))
    (setq Names (cons (cdr (assoc 2 UCS)) Names))
    )
    (reverse Names)
    )

    Or, you could use the ActiveX style...
    (defun UCSNames ( / Names)
    (vlax-for UCS
    (vla-get-usercoordinatesystems
    (vla-get-activedocument
    (vlax-get-acad-object)
    )
    )
    (setq Names
    (cons (vla-get-name UCS) Names)
    )
    )
    (reverse Names)
    )

    Wow. The older way does look easier, but give it up.
     
    John Uhden, Feb 3, 2004
    #2
  3. W. Kirk Crawford

    R.K. McSwain Guest

    One way....

    (setq ucslst '())
    (vlax-for x
    (vlax-get (vlax-get (vlax-get-acad-object) "ActiveDocument")
    "UserCoordinateSystems"
    )
    (setq ucslst (cons (vlax-get x "Name") ucslst))
    )
     
    R.K. McSwain, Feb 3, 2004
    #3
  4. W. Kirk Crawford

    Doug Broad Guest

    Kirk,
    Why even worry about it? If all you want to do is go
    back to a previous coordinate system then use the
    previous option of the ucs command. Don't save
    them before setting up a new one.
     
    Doug Broad, Feb 3, 2004
    #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.