Different results whether WCS origin is visible or not

Discussion in 'AutoCAD' started by W.H.O., Mar 17, 2005.

  1. W.H.O.

    W.H.O. Guest

    I seem to have a problem with copying elements; depending on the visibility of WCS origin in active view I get different results. Is this a known problem and is there a solution??
    I isolated the problem in the following code:

    (defun C:test ()
    (setq oldosmode (getvar "OSMODE")
    old_follow (getvar "UCSFOLLOW")
    old_ucsicon (getvar "UCSICON")
    old_ucsorg (getvar "UCSORG")
    old_ucsxdir (getvar "UCSXDIR"))
    (command "_.UNDO" "_G" )
    (setvar "UCSICON" 2)
    (setvar "UCSFOLLOW" 0 )
    ; preserve start-UCS
    (command "UCS" "WORLD")
    (setq old_ucsxpoint (polar old_ucsorg (angle '(0 0) old_ucsxdir)1.0 ))
    ;--------------------
    (setq angdata '( 0.0 (/ pi 2) pi))
    (setq en (car (entsel)) ct 0 dist 15.0)
    (setvar "OSMODE" 0)
    (while (< ct 3)
    (setq ang1 (eval(nth ct angdata)))
    (entmake (append
    (list '(0 . "LINE"))
    (list (cons 10 '(0 0)))
    (list (cons 11 (polar '(0 0) ang1 1)))
    ))
    (command "UCS" "Object" "Last" )
    (entdel (entlast))
    (command "_.COPY" en "" "0,0" (list dist 0))
    (setq ct (1+ ct))
    )
    ; restore UCS
    (entmake (append
    (list '(0 . "LINE"))
    (list (cons 10 old_ucsorg ))
    (list (cons 11 old_ucsxpoint ))
    ))
    (command "UCS" "Object" "Last" )
    (entdel (entlast))
    ;-----------
    (setvar "OSMODE" oldosmode)
    (setvar "UCSICON" old_ucsicon)
    (setvar "UCSFOLLOW" old_follow )
    (command "_.UNDO" "_E" )
    )
     
    W.H.O., Mar 17, 2005
    #1
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.