Author Topic: Challenge: get an updated viewdir  (Read 3089 times)

0 Members and 1 Guest are viewing this topic.

Bryco

  • Water Moccasin
  • Posts: 1883
Challenge: get an updated viewdir
« 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.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Challenge: get an updated viewdir
« Reply #1 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)))))
« Last Edit: October 14, 2006, 05:30:09 PM by CAB »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Bryco

  • Water Moccasin
  • Posts: 1883
Re: Challenge: get an updated viewdir
« Reply #2 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)