Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/25/2019 in all areas

  1. Try the code below. Note 1: I haven't fully tested the code. I cannot run utmgeo.VLX as I use BricsCAD instead of AutoCAD. Also I would probably need a sample dwg with the highlighter block inserted in a 'feasible' location. If you have the source of the VLX and such a dwg please post them. Note 2: The highlighter block has to already be inserted before calling the SvUpdate command. (vl-load-com) (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))) ) ; (SvUpdate_Browser "https://www.cadtutor.net/forum/forum/15-autolisp-visual-lisp-amp-dcl/") (defun SvUpdate_Browser (url) (if (or (and *SvUpdate_browser* (KGA_Sys_ApplyAlt 'vlax-get-property (list *SvUpdate_browser* 'visible)) ; Check if object is still available. (princ "\nUpdating StreetView in browser ") ) (and (princ "\nStarting StreetView in browser. Please wait... ") (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) ) ) ) (defun SvUpdate_CallBackModified (obj rea lst / pt) (if (and (vlax-read-enabled-p obj) (not (equal (vlr-data rea) (setq pt (vlax-get obj 'insertionpoint)) 1e-8)) ; Perhaps higher fuzz? ) (progn ; (print "SvUpdate_CallBackModified") (vlr-data-set rea pt) (SvUpdate_Move pt) ) ) ) (defun SvUpdate_Move (pt) (setq pt (utmgeo pt 6378160.0 298.25 18 "N")) (SvUpdate_Browser (strcat "https://www.google.com/maps?ie=UTF8&layer=c&cbll=" (rtos (cadr pt) 2 8) "," (rtos (car pt) 2 8) "&cbp=1,0,,0,5&z=16" ) ) ) (defun c:SvUpdate ( / obj pt ss) (if (and (or (setq ss (ssget "_X" '((2 . "highlighter")))) (prompt "\nError: 'highlighter' block not found ") ) (or (= 1 (sslength ss)) (prompt "\nError: more than 1 'highlighter' block found ") ) ) (progn (if *SvUpdate_objectReactor* (vlr-remove *SvUpdate_objectReactor*) ) (setq *SvUpdate_objectReactor* (vlr-object-reactor (list (setq obj (vlax-ename->vla-object (ssname ss 0)))) (setq pt (vlax-get obj 'insertionpoint)) ; Reactor data. '( (:vlr-modified . SvUpdate_CallBackModified) ) ) ) (SvUpdate_Move pt) ) ) (princ) )
    1 point
  2. Using Internet Explorer for this type of automation would be easier as you can then use ActiveX.
    1 point
  3. Your biggest problem may be communicating with Chrome. When you run the Openlinkinchrome function multiple times are URLs opened in the same window? Or can you set a preference to accomplish this?
    1 point
  4. Can you explain why you want to achieve this?
    1 point
×
×
  • Create New...