what happens after you display the slice ?
Could be several different things. The routine will be the "engine" for a couple of other functions like saving the view for recalling in a layout viewport.
The concept is to provide an easy method of extracting col. line elevations and plan views of different floors for placing in layouts in preparation for annotation.
I think we may need some lateral thinking here.
I'll take any kind of thinking right now, lateral or otherwise.
Mark Thomas on the CADalog board suggested using grread and at first glance it didn't help, but a friend over on the AutoDESK boards came up with something quite different. So here's the latest attempt, it has a couple of bugs with small viewports or moving the cursor too fast:
(setq dvsdeep 12.0)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun DVSection (/ pt1 pt2 ang)
(command ".undo" "begin")
(if (= (getvar "cvport") 1)
(command ".mspace")
)
(command "ucs" "v")
(setq pt1 (getpoint "\nSelect Centerpoint of Section: "))
(setq ang (getangle pt1 "\nEnter Viewing Point Angle from Section: "))
(setq curvp (getvar "cvport"))
(setq pt2 (polar pt1 ang 12))
(IF (SETQ Ndvsdeep (GETDIST (STRCAT "Enter Depth of Section: <" (RTOS dvsdeep) ">: ")))
(setq dvsdeep ndvsdeep)
)
(setq pt1 (trans pt1 1 0) pt2 (trans pt2 1 0))
(command "ucs" "w")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; the following by ruul morawetz
(defun rm:cvpc ( / grrd weida p pold viewsize trigger)
(setq weida T
viewsize (getvar "VIEWSIZE")
trigger (* viewsize 0.1)
)
(while weida (setq grrd (grread T))
(cond
((= 5 (car grrd)) (setq p (cadr grrd))
(cond
((and pold (> (distance p pold) trigger)) (setq weida nil) ) ) (setq pold p) ) ((= 2 (car grrd))(setq weida nil)) (T nil ) )
) ;;end while
) ;;end defun
(prompt "\n Select Viewport for Section Display (ENTER if necessary then) ")
(rm:cvpc)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
(command "dview" "" "po" pt1 pt2 "cl" "f" (/ dvsdeep 2.0) "cl" "b" (- 1.0 (/ dvsdeep 2.0)) "")
(command ".zoom" "e" ".zoom" ".8x")
(setvar "cvport" curvp)
(command ".undo" "end")
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun c:dvs () (command ".undo" "begin")(dvsection)(command ".undo" "end"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;