Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Setting UCS entries from autolisp

996 views
Skip to first unread message

Hesham Mohieddin Aboba Elgharib

unread,
Feb 20, 1997, 3:00:00 AM2/20/97
to

I need your help:

I would like to change the UCS settings without issuing
the (command "ucs" ...) in an autolisp transparent routine.

I know I can read the initial UCS?DIR and UCSORG sys variables.
But how can I change these values in the database from inside
autolisp? I looked at the manual but it seems quite complicated.

I am looking for a function which I can call with UCSXDIR, UCSYDIR
and UCSORG to set the current UCS in the database. What if there is only
the World UCS (ie the user did not save any other?) Do I need to create
one, then reset back to WOrld when done? How?

Any help would be greatly appreciated.
--
HESHAM ELGHARIB
331280 GATECH STATION
Atlanta, GA. 30332 Internet: gt1...@prism.gatech.edu

Reini Urban

unread,
Feb 25, 1997, 3:00:00 AM2/25/97
to

This worked for me: (in R12 even transparent, R13 is a %$%$!)

;;; save the UCS list
(defun ur_getucs ()
(list (getvar "UCSORG")(getvar "UCSXDIR")(getvar "UCSYDIR"))
)

;;; restore saved UCS '(UCSORG UCSXDIR UCSYDIR)
(defun ur_setucs (ucs / u x y)
(setq u (trans (car ucs) 0 1)
x (mapcar '+ u (trans (cadr ucs) 0 1 t))
y (mapcar '+ u (trans (caddr ucs) 0 1 t)))
(command "_.UCS" "_3" "_NON" u "_NON" x "_NON" y)
)

sample:
(ur_setucs (ur_getucs))

or:
(setq ucs (ur_getucs)) ;save the ucs
;;set the origin 10 to the right
(ur_setucs (list (mapcar '+ (10 0 0)(car ucs))
'(1 0 0)
'(0 1 0))
...
(ur_setucs ucs) ;restore old

- Reini
AutoCAD stuff: http://xarch.tu-graz.ac.at/autocad/

0 new messages