Thanks for those files. It works on my machine as well.
Here is a new version of the code. The angle of the block is now translated to the heading in SV.
The code assumes a (static) block containing an arrow pointing east.
(vl-load-com)
(defun KGA_Math_LimitAngleRange (ang)
(rem (+ (rem ang (+ pi pi)) pi pi) (+ pi pi))
)
(defun KGA_Math_Rad_To_Dgr (rad)
(* (/ rad pi) 180.0)
)
(defun KGA_Sys_Apply (expr varLst / ret)
(if (not (vl-catch-all-error-p (setq ret (vl-catch-all-apply expr varLst))))
ret
)
)
(defun KGA_Sys_ApplyAlt (expr varLst)
(not (vl-catch-all-error-p (vl-catch-all-apply expr varLst)))
)
; 20190626: Revised.
; 20190625
(defun SvUpdate_CallBackModified (obj rea lst / dat)
(if
(and
(vlax-read-enabled-p obj)
(setq dat
(list
(vlax-get obj 'insertionpoint)
(vlax-get obj 'rotation)
)
)
(not (equal dat (vlr-data rea) 1e-8)) ; Perhaps higher fuzz?
)
(progn
; (print "SvUpdate_CallBackModified")
(vlr-data-set rea dat)
(SvUpdate_ChangeView (car dat) (cadr dat))
)
)
)
; 20190626: Revised.
; 20190626: Renamed.
; 20190625
; https://www.google.com/maps/@?api=1&map_action=pano&viewpoint=48.857832,2.295226&heading=-45
(defun SvUpdate_ChangeView (pt ang)
(setq pt (utmgeo pt 6378160.0 298.25 18 "N"))
(setq ang (KGA_Math_Rad_To_Dgr (KGA_Math_LimitAngleRange (- (* 0.5 pi) ang))))
(princ "\nPlease wait... ")
(SvUpdate_Navigate
(strcat
"https://www.google.com/maps/@?api=1"
"&map_action=" "pano"
"&viewpoint=" (rtos (cadr pt) 2 8) "," (rtos (car pt) 2 8)
"&heading=" (rtos ang 2 0)
)
)
)
; 20190626: Removed some prompts.
; 20190626: Renamed.
; 20190625
; (SvUpdate_Navigate "https://www.cadtutor.net/forum/forum/15-autolisp-visual-lisp-amp-dcl/")
(defun SvUpdate_Navigate (url)
(if
(or
(and
*SvUpdate_browser*
(KGA_Sys_ApplyAlt 'vlax-get-property (list *SvUpdate_browser* 'visible)) ; Check if object is still available.
)
(and
(or
(setq *SvUpdate_browser* (KGA_Sys_Apply 'vlax-get-or-create-object '("internetexplorer.application")))
(prompt "\nError: Internet Explorer cannot be started ")
)
(progn
(setvar 'cmdecho 0)
(command "_.delay" 2000)
(setvar 'cmdecho 1)
)
)
)
(progn
(vlax-put-property *SvUpdate_browser* 'visible :vlax-true)
(vlax-invoke-method *SvUpdate_browser* 'navigate url)
)
)
)
; 20190626: Revised.
; 20190625
; The selected (static) block should contain an arrow pointing east.
(defun c:SvUpdate ( / dat enm obj)
(if
(and
(setq enm (car (entsel)))
(setq obj (vlax-ename->vla-object enm))
(or
(= "AcDbBlockReference" (vla-get-objectname obj))
(prompt "\nError: this is not a block reference ")
)
)
(progn
(if *SvUpdate_objectReactor*
(vlr-remove *SvUpdate_objectReactor*)
)
(setq *SvUpdate_objectReactor*
(vlr-object-reactor
(list obj)
(setq dat ; Reactor data.
(list
(vlax-get obj 'insertionpoint)
(vlax-get obj 'rotation)
)
)
'(
(:vlr-modified . SvUpdate_CallBackModified)
)
)
)
(SvUpdate_ChangeView (car dat) (cadr dat))
)
)
(princ)
)
Sample_new.dwg