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
Solved! Go to Solution.
Solved by rkmcswain. Go to Solution.
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) )
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
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.