Author Topic: Open Google Earth  (Read 7011 times)

0 Members and 1 Guest are viewing this topic.

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1451
  • Marco
Re: Open Google Earth
« Reply #15 on: April 10, 2018, 04:57:48 AM »
Thanks a lot, but seems that google earch api is gone in new versions......

Maybe this can help: http://www.cruisersforum.com/forums/f121/google-earth-api-gone-144392.html

Thanks Marco.

NICK_VNV: in that case (as Marco):

Code: [Select]
$ (findfile "C:\\Program Files\\Google\\Google Earth Pro\\client\\earthps.dll")
nil
_$ (findfile "C:\\Program Files\\Google\\Google Earth Pro\\client\\googleearth.exe")
"C:\\Program Files\\Google\\Google Earth Pro\\client\\googleearth.exe"


$ (vlax-import-type-library
  :tlb-filename
  "C:\\Program Files\\Google\\Google Earth Pro\\client\\googleearth.exe"
  :methods-prefix
  "vlg-"
  :properties-prefix
  "vlg-"
  :constants-prefix
  "gec-"
)
; error: tipo de argumento erróneo: VLA-OBJECT nil



Maybe uninstall the last version and install older is the solution.

Thanks everybody and sorry about my english.
me too:
$ (vlax-import-type-library  :tlb-filename  "C:\\Program Files\\Google\\Google Earth Pro\\client\\googleearth.exe"  :methods-prefix   "vlg-"   :properties-prefix   "vlg-"  :constants-prefix   "gec-")
; error: tipo de argumento erróneo: VLA-OBJECT nil

NICK_VNV

  • Newt
  • Posts: 63
Re: Open Google Earth
« Reply #16 on: April 10, 2018, 05:32:45 AM »
I am using Google Earth Pro 7.3.1.4507 (32-bit) and everything works fine. What version do you have?
Sorry for my English...

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1451
  • Marco
Re: Open Google Earth
« Reply #17 on: April 10, 2018, 07:40:27 AM »
I am using Google Earth Pro 7.3.1.4507 (32-bit) and everything works fine. What version do you have?
I am using Google Earth Pro 7.3.1.4507 (64-bit)

NICK_VNV

  • Newt
  • Posts: 63
Re: Open Google Earth
« Reply #18 on: April 10, 2018, 08:10:07 AM »
I am using Google Earth Pro 7.3.1.4507 (32-bit) and everything works fine. What version do you have?
I am using Google Earth Pro 7.3.1.4507 (64-bit)

I have uninstalled 32bit version and installed 64 bit version. Now I have the same problem.
It seems we need to use 32bit version.

p.s.
Yep I've reverted back to 32bit and it works fine again.
« Last Edit: April 10, 2018, 08:23:09 AM by NICK_VNV »
Sorry for my English...

dgpuertas

  • Newt
  • Posts: 80
Re: Open Google Earth
« Reply #19 on: April 10, 2018, 08:17:08 AM »
My version
Google Earth Pro
7.3.1.4507 (64-bit)

but, can i install 32bit software in a 64bit computer?




NICK_VNV

  • Newt
  • Posts: 63
Re: Open Google Earth
« Reply #20 on: April 10, 2018, 08:18:02 AM »
My version
Google Earth Pro
7.3.1.4507 (64-bit)

but, can i install 32bit software in a 64bit computer?
Ofcourse
Sorry for my English...

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1451
  • Marco
Re: Open Google Earth
« Reply #21 on: April 10, 2018, 09:06:07 AM »
My version
Google Earth Pro
7.3.1.4507 (64-bit)

but, can i install 32bit software in a 64bit computer?
Ofcourse
Thanks  :-)

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Open Google Earth
« Reply #22 on: April 10, 2018, 10:20:36 AM »
Quote from: NICK_VNV

I have uninstalled 32bit version and installed 64 bit version. Now I have the same problem.
It seems we need to use 32bit version.

p.s.
Yep I've reverted back to 32bit and it works fine again.

Good to know. It seems that Plex.Earth suffers from the same issue, must have 32-bit version of GE installed.

https://plexscape.zendesk.com/hc/en-us/articles/216073463-Communication-with-Google-Earth-Issue?mobile_site=true





d2010

  • Bull Frog
  • Posts: 323
Re: Open Google Earth
« Reply #23 on: August 08, 2022, 01:20:53 PM »
Google Earth Pro
7.3.1.4507 (64-bit)
But, can i install 32bit software in a 64bit computer?
:straight:
Sure, but your AcadVer but an exactly version-type with GoogleEarth.
Code: [Select]
//Eg1. Autocad2014.exe version x86 and GoogleEarth.x86
//Eg2. Autocad2014,exe version x64 == GoogleEarth.x64
Other solution/s check>your WindowsRegistry with
"Spy Search and Destroy.exe"
"Windoc.exe from NortonUtitiles", because "winRegistry for 'COM" contain damage-informations.
"Check the virus Attack with BitDefender.exe":
 :glare:

« Last Edit: August 08, 2022, 01:28:51 PM by d2010 »

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8659
  • AKA Daniel
Re: Open Google Earth
« Reply #24 on: August 08, 2022, 10:12:48 PM »
there's a web version too


MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Re: Open Google Earth
« Reply #25 on: August 15, 2022, 07:52:13 AM »
Where or how did you find about Google Earth within CAD? lol. Thats pretty neat.
Civil3D 2020

CodeDing

  • Newt
  • Posts: 50
Re: Open Google Earth
« Reply #26 on: August 15, 2022, 01:26:50 PM »
MSTG007,

Where or how did you find about Google Earth within CAD? lol. Thats pretty neat.
..."Google Earth within CAD" might be a little deceptive. It's just a web page. Probably using the Javascript API!

Source:
https://help.autodesk.com/view/OARX/2022/ENU/?guid=adsk_jsdev_autocad_javascript_api_about

To Test:
Save this as html document..
Code: [Select]
<html>
   <head>
       <title>Some Title</title>
       <script type="text/javascript" src="https://df-prod.autocad360.com/jsapi/v3/Autodesk.AutoCAD.js ">
       </script>
       <script type="text/javascript">

           function myFunction() {
             Acad.Application.addDocWindow("Another Title", "https://www.theswamp.org/index.php?topic=54086.msg611080#msg611080");
           }

           myFunction();

       </script>
   </head>

   <body>

   </body>
</html>

...then run code to execute your html...
Code: [Select]
(command "_.WEBLOAD" "l" "c:\\users\\me\\desktop\\myWebDocument.html")
Best,
~DD
~DD
Senior CAD Tech & AI Specialist
Need AutoLisp help?
Try my custom GPT 'AutoLISP Ace'

CodeDing

  • Newt
  • Posts: 50
Re: Open Google Earth
« Reply #27 on: August 15, 2022, 01:34:42 PM »
To maintain the integrity of OP's original question though, last year I posted a routine to do just what was requested:

Code - Auto/Visual Lisp: [Select]
  1. (defun c:EARTH ( / *error* GeoMarker PT->LL errMsg earthPath ptMid ptLL strKML fName f)
  2. ;; Opens Google Earth. If dwg is Geo-Located, attempts to open at user-specified location.
  3.   ;; Helper Function(s)
  4.   ;; Error handler
  5.   (defun *error* (msg / )
  6.     (if (not (member msg '("Function cancelled" "quit / exit abort")))
  7.       (princ (strcat "\nError: " msg))
  8.     );if
  9.     (princ)
  10.   );error defun
  11.   (defun GeoMarker ( / ) ;; Creates arbitrary GeoMarker, returns ename
  12.     (entmakex '((0 . "POSITIONMARKER") (100 . "AcDbEntity") (100 . "AcDbGeoPositionMarker") (90 . 0) (10 0.0 0.0 0.0) (40 . 1.0)
  13.                (1 . "") (40 . 0.5) (290 . 0) (280 . 0) (290 . 1) (101 . "Embedded Object") (100 . "AcDbEntity") (100 . "AcDbMText")
  14.                (10 0.1 0.1 0.0) (40 . 1.0) (1 . "") (210 0.0 0.0 1.0) (11 1.0 0.0 0.0) (42 . 9761.9) (43 . 6666.67)))
  15.   );GeoMarker defun
  16.   (defun PT->LL (pt / e luprec return) ;; Returns Longitude & Latitude of point provided
  17.     (if (setq e (GeoMarker))
  18.       (progn
  19.         (setq e (vlax-ename->vla-object e))
  20.         (vlax-put-property
  21.           e
  22.           'Position
  23.           (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbdouble '(0 . 2)) pt))
  24.         );vlax
  25.         (setq luprec (getvar 'LUPREC))
  26.         (setvar 'LUPREC 8)
  27.         (setq return
  28.           (mapcar
  29.             'atof
  30.             (list (vla-get-Longitude e) (vla-get-Latitude e) "0.")
  31.           );mapcar
  32.         );setq
  33.         (setvar 'LUPREC luprec)
  34.         (vla-delete e)
  35.         return
  36.       );progn
  37.     );if
  38.   );PT->LL defun
  39.   ;; Initial checks
  40.   (cond
  41.     ((not (setq earthPath (vl-registry-read "HKEY_LOCAL_MACHINE\\SOFTWARE\\Google\\Google Earth Pro" "InstallLocation")))
  42.       (setq errMsg "\nCould not locate Google Earth application.")
  43.     );cond 1
  44.     ((not (eq "Model" (getvar 'CTAB))) (setq errMsg "\nMust be in Model space to select location."))
  45.     ((eq "" (getvar 'CGEOCS)) (setq errMsg "\nDrawing is not Geo-Located."))
  46.   );cond
  47.   (if earthPath (setq earthPath (strcat earthPath "googleearth.exe")))
  48.   ;; Open Earth now if path found and error found, or test for other error.
  49.   (cond
  50.     ((and earthPath errMsg) (startapp earthPath) (prompt errMsg) (exit))
  51.     (errMsg (prompt errMsg) (alert errMsg) (exit))
  52.   );cond
  53.   (prompt "\nPreparing to open location in Google Earth...")
  54.   ;; User-selected or arbitrary mid point of project data
  55.   (setq ptMid
  56.     (cond ((getpoint "\nSelect Point or (Enter) for default: "))
  57.           ((getvar 'VIEWCTR))
  58.     );cond
  59.   );setq
  60.   ;; Transform to Lat Long
  61.   (setq ptLL (PT->LL ptMid))
  62.   (print ptLL)
  63.   ;string for KML file
  64.   (if *earth_marker_count*
  65.     (setq *earth_marker_count* (1+ *earth_marker_count*))
  66.     (setq *earth_marker_count* 1)
  67.   );if
  68.   (setq strKML
  69.     (strcat
  70.       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
  71.       "<kml xmlns=\"http://www.opengis.net/kml/2.2\" xmlns:gx=\"http://www.google.com/kml/ext/2.2\" xmlns:kml=\"http://www.opengis.net/kml/2.2\" xmlns:atom=\"http://www.w3.org/2005/Atom\">"
  72.       "  <Placemark>"
  73.       "    <name>" (getvar 'DWGNAME) " (" (itoa *earth_marker_count*) ")</name>"
  74.       "    <Point>"
  75.       "      <coordinates>" (rtos (car ptLL) 2 7) "," (rtos (cadr ptLL) 2 7) ",0</coordinates>"
  76.       "    </Point>"
  77.       "  </Placemark>"
  78.       "</kml>"
  79.     );strcat
  80.   );setq
  81.   ;; Write string to KML file
  82.   (setq fName (vl-filename-mktemp "C3D" nil ".kml"))
  83.   (write-line strKML (setq f (open fName "w")))
  84.   (close f)
  85.   ;; Open KML in Google Earth
  86.   (startapp earthPath fName)
  87.   (prompt "\nEARTH Complete.")
  88.   (princ)
  89. );defun
  90.  

Sauce:
https://forums.autodesk.com/t5/civil-3d-customization/google-earth-command-in-autocad/td-p/10598071

Best,
~DD
~DD
Senior CAD Tech & AI Specialist
Need AutoLisp help?
Try my custom GPT 'AutoLISP Ace'

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8659
  • AKA Daniel
Re: Open Google Earth
« Reply #28 on: August 16, 2022, 02:59:54 AM »
MSTG007,

Where or how did you find about Google Earth within CAD? lol. Thats pretty neat.
..."Google Earth within CAD" might be a little deceptive. It's just a web page. Probably using the Javascript API!

yeah AutoCAD has a built in web browser, as you found, I used C++ function acedAddHTMLDocWindow(TITLE, URL)
surprised its not in lisp