(setview)

(setview view-descriptor [vport])


Create a 3-D viewpoint.


This function changes the 3-D viewpoint of a specified viewport.

The view-descriptor argument is not the simple x,y,z coordinates, such as '(1.0 2.0 3.0), that you might expect from the Viewpoint command. Instead, it requires the view descriptor table as returned by the tblsearch function. The data is in dotted-pair format and looks like the following:

((0 . "VIEW") (2 . "ASDF") (70 . 0) (40 . 7.76066) (10 7.49352 4.5)

(41 . 12.2537) (11 0.0 0.0 1.0) (12 0.0 0.0 0.0) (42 . 50.0) (43 . 0.0)

(44 . 0.0) (50 . 0.0) (71 . 0))

Example

One easy way to create the viewpoint data is with the View Save command. The example code below shows how to create and get this data.

Code Comments
(command "view" "s" "asdf") 1. Create a viewpoint named ASDF.
(setq vp (tblsearch "VIEW" "asdf")) 2. Get the viewpoint data.
(setq cv (getvar "cvport")) 3. Get the current viewport number.
(setview vp cv) 4. Set the viewpoint in the viewport.

NOTE The vport argument is an optional integer that specifies the viewport number. When you have a single viewport, the argument is not required; the default value is 2. To get the number of the current viewport, use the Cvport system variable, as in the above example.

Tell me about...

(setq symbol1 statement1 [symbol2 statement2] ...)

(vports)

LISP Compatibility

Programming Overview of LISP (LISt Processing) Language