Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

link to google map

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
solarch
1763 Views, 4 Replies

link to google map

Hello all, I have this problem with this basic autolisp code. I wanted to link the longitude and lattitude of my autocad project with the same location on google map for a quick reference. so i wrote this 

                    (defun C:googleMap ( )


                    (setq googleMap "https://maps.google.com/maps?q=loc:32.746635,-97.319549") 

                     (startapp "explorer" google)                                                                                     
                    )

 

the code works with other urls like "https://maps.google.com" but not with this specific kind of url  

"https://maps.google.com/maps?q=loc:32.746635,-97.319549"

it throws this error message

 

"There is no program associated to perform the requested action. Please install a program or, if one is already installed, create an association in the Default Programs control panel.

 

appreciate any help

 

Solomon Tessema

4 REPLIES 4
Message 2 of 5
rkmcswain
in reply to: solarch

Try the following:

 

(defun C:googleMap  ( / filename shell)
  (setq filename "https://maps.google.com/maps?q=loc:32.746635,-97.319549")
  (setq shell
         (vla-getinterfaceobject
           (vlax-get-acad-object)
           "Shell.Application"
           )
        )
  (vlax-invoke-method shell 'Open filename)
  (vlax-release-object shell)
)

 

R.K. McSwain     | CADpanacea | on twitter
Message 3 of 5
solarch
in reply to: rkmcswain

It is working like a charm! many thanks

Message 4 of 5
paullimapa
in reply to: solarch

Or you can change the code to use the SH command placing quotes around the URL:

(defun c:googlemap () (setq googlemap "Explorer \"https://maps.google.com/maps?q=loc:32.746635,-97.319549\"")(command"_SH" googlemap))

 

 

Area Object Link | Attribute Modifier | Dwg Setup | Feet-Inch Calculator
Layer Apps | List on Steroids | VP Zoom Scales | Exchange App Store


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 5 of 5
kroberts5FHL4
in reply to: paullimapa

This is great, but shouldn't the code grab the location you select onscreen? I knew AutoLisp years ago but haven't used it recently. I'll keep looking.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost