Rotate UCS / view to object but restore UCSFollow to 0

Rotate UCS / view to object but restore UCSFollow to 0

SRSDS
Advisor Advisor
425 Views
2 Replies
Message 1 of 3

Rotate UCS / view to object but restore UCSFollow to 0

SRSDS
Advisor
Advisor

I use these three lisp commands to manipulate the view.

(defun c:UO()
(command "._UCSFollow" "1" "UCS" "N" "Ob" )
)
(defun c:UP()
(command "._UCSFollow" "1" "UCS" "P")
)
(defun c:UW()
(command "._UCSFollow" "1" "._UCS" "W" "._UCSFollow" "0" )
)

 

Is it possible to restore the UCSFollow system variable to "0" in UO command?

Using this line, the selection of an object seems to interfere with the set of commands.

(command "._UCSFollow" "1" "UCS" "N" "Ob" "._UCSFollow" "0" )

UW works fine. I guess because there is not object that needs selecting.

0 Likes
Accepted solutions (1)
426 Views
2 Replies
Replies (2)
Message 2 of 3

ВeekeeCZ
Consultant
Consultant
Accepted solution

@SRSDS wrote:

I use these three lisp commands to manipulate the view.

(defun c:UO()
(command "._UCSFollow" "1" "UCS" "N" "Ob" )
)
(defun c:UP()
(command "._UCSFollow" "1" "UCS" "P")
)
(defun c:UW()
(command "._UCSFollow" "1" "._UCS" "W" "._UCSFollow" "0" )
)

 

Is it possible to restore the UCSFollow system variable to "0" in UO command?

Using this line, the selection of an object seems to interfere with the set of commands.

(command "._UCSFollow" "1" "UCS" "N" "Ob" pause "._UCSFollow" "0" )

UW works fine. I guess because there is not object that needs selecting.


 

PAUSE for a (single) user input

 

 

I use this (in 2D)

;-----
(defun c:UCS_O (/ *error* vc vs)   ;object
  
  (setq vc (trans (getvar 'viewctr) 1 0)
	vs (getvar 'viewsize))
  (vla-startundomark (vla-get-activedocument (vlax-get-acad-object)))
  (command "_.UCS"  "_OB" pause
	   "_.PLAN" "_C"
	   "_.ZOOM" "_C" (trans vc 0 1) vs)
  (vla-endundomark (vla-get-activedocument (vlax-get-acad-object)))
  (command "_.REGEN")
  (princ)
  )

 

0 Likes
Message 3 of 3

SRSDS
Advisor
Advisor

Thank you so much. For years I've been wondering who (or what) is turning on UCSFollow in viewports causing that zoom extents problem. It's been me. 

0 Likes