TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Bryco on October 14, 2006, 03:32:29 PM

Title: Challenge: get an updated viewdir
Post by: Bryco on October 14, 2006, 03:32:29 PM
Vba doesn't seem to have a way to get an updated viewdir, I'm hoping lisp has the wherewithall.
By updated I mean like viewctr, you pan or zoom and you get a new one.
Title: Re: Challenge: get an updated viewdir
Post by: CAB on October 14, 2006, 05:27:54 PM
Not sure but are you looking for dxf code 16?
Quote
16   View direction from target point (in WCS)
       DXF: X value; APP: 3D point

I did not see the vlisp property for this.
When the vp is active (getvar "VIEWDIR") returns ir for the vp.

Within paper space this will return it.
Code: [Select]
(cdr (assoc 16 (entget (car(entsel)))))
Title: Re: Challenge: get an updated viewdir
Post by: Bryco on October 14, 2006, 05:58:37 PM
Cab, I'm using this in modelspace. Neither this (16)  or the getvar "viewdir" update with pan or zoom , (nor does target) but calling the camera command will show a new target and new camera.
 VIEWDIR System Variable                                                                                         
Stores the viewing direction in the current viewport expressed in UCS coordinates.
This describes the camera point as a 3D offset from the target point.
( The length from zero to the viewdir point=length of camera-target so I'm after the new length)