Author Topic: Startapp explorer long urls??  (Read 1325 times)

0 Members and 1 Guest are viewing this topic.

dubb

  • Swamp Rat
  • Posts: 1105
Startapp explorer long urls??
« on: November 13, 2018, 12:16:05 PM »
This snippet opens the windows explorer
Code: [Select]
(startapp "explorer" "https://www.google.com/maps/@?api=1&map_action=pano&viewpoint=33.18973,-117.27724&heading=0&pitch=0&fov=100")
This one opens up the url in my default browser
Code: [Select]
(startapp "explorer" "https://www.google.com")

This is my short code. I have two custom properties in dwgprops called "LATITUDE" and "LONGITUDE"

Code: [Select]
(defun c:stv ()
  (setq lst (cd:DWG_GetCustomProp(cd:ACX_ADoc) ))
  (setq url (strcat "https://www.google.com/maps/@?api=1&map_action=pano&viewpoint="(CDR (assoc "LATITUDE" lst))","(CDR (assoc "LONGITUDE" lst))"&heading=0&pitch=0&fov=100"))
  (startapp "explorer" url)
  (princ)
  )
(defun cd:DWG_GetCustomProp (Doc / si n k v lst)
  (setq si (vla-get-SummaryInfo Doc)
        n (vla-NumCustomInfo si)
  )
  (while (> n 0)
    (vla-GetCustomByIndex si (- n 1) 'k 'v)
    (setq lst (cons (cons k v) lst)
          n (1- n)
    )
  )
  lst
)

Why does this happen

I have looked at this but none of them work for me.
https://www.theswamp.org/index.php?topic=44768.msg499867#msg499867

dubb

  • Swamp Rat
  • Posts: 1105
Re: Startapp explorer long urls??
« Reply #1 on: November 13, 2018, 12:24:24 PM »
Nevermind, i had to use escape quotes.
Code: [Select]
(defun c:stv ()
  (setq lst (cd:DWG_GetCustomProp(cd:ACX_ADoc) ))
  (setq url (strcat "\"https://www.google.com/maps/@?api=1&map_action=pano&viewpoint="(CDR (assoc "LATITUDE" lst))","(CDR (assoc "LONGITUDE" lst))"&heading=0&pitch=0&fov=100\""))
  (startapp "explorer" url)
  (princ)
  )