Author Topic: Pass html address through wscript  (Read 1032 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Pass html address through wscript
« on: September 22, 2020, 11:29:11 AM »
Is it possible to send a web link generated by lisp into a wscript to open a browser? Currently when I have the list open the browser it does not work. Not sure why.

Basically the user picks a window which will have coordinates to it. It then takes those coordinates to a web link, then opens the browser.

Here is the example I used
Code: [Select]
http://websoilsurvey.nrcs.usda.gov/app/WebSoilSurvey.aspx?marker=(-84.60032 46.23243)
Here is the web address pushed out from CAD.
Code: [Select]
http://websoilsurvey.nrcs.usda.gov/app/WebSoilSurvey.aspx?marker=(-87.076767%2039.886893)Note: If I copy the address directly into a browser, it works.

This is the error I get from the website.
Code: [Select]
URL Errors
marker:
Invalid location marker: Invalid coordinate point "((-87.076767 39.886893))" 

This is the info from the command line.
Code: [Select]
Pick the Area of Interest within Modelspace:
 X,Y: 2954592.554323,1689496.162064
 Projection SOURCE :  IN83-WF
 Projection CIBLE(Target) :  WGS84 datum, Latitude-Longitude; Degrees
 Longitude,Latitude: -87.076767,39.886893

This is the program. Make sure you set a coordinate system first to run it.
Code: [Select]
(defun c:soil (/ COORDS LONGLAT LONG LAT PROJDEST PROJSRC )
(setq PROJSRC (ade_projgetwscode))
(if (/= (getvar "ctab") "Model") (command "_layout" "Set" "Model"))
(ade_projsetsrc PROJSRC)
(ade_projsetdest "LL84")
(setq COORDS (getpoint "\nPick the Area of Interest within Modelspace: "));;; Pick a Window?
(setq LONGLAT (ade_projptforward COORDS))
(setq LONG (car LONGLAT))
(setq LONG (rtos LONG 2 6))
(setq LAT (car (cdr LONGLAT)))
(setq LAT (rtos LAT 2 6))
(setq PROJDEST (ade_projgetinfo "LL84" "description"))
(princ (strcat
"\n X,Y: " (rtos (car COORDS) 2 6) "," (rtos (cadr COORDS) 2 6)
"\n Projection SOURCE :  " PROJSRC
"\n Projection CIBLE(Target) :  " PROJDEST
"\n Longitude,Latitude: " LONG "," LAT
"\n"))
(setq Website (strcat "https://websoilsurvey.nrcs.usda.gov/app/WebSoilSurvey.aspx?marker=((" LONG " " LAT "))")) ;;http://websoilsurvey.nrcs.usda.gov/app/WebSoilSurvey.aspx?marker=(-84.60032 46.23243)
(command "_browser" Website)
(princ)
)
(C:soil)


Thanks for any help with this! Let me know if this does not make sense please.
« Last Edit: September 22, 2020, 11:39:35 AM by MSTG007 »
Civil3D 2020

VovKa

  • Water Moccasin
  • Posts: 1631
  • Ukraine
Re: Pass html address through wscript
« Reply #1 on: September 22, 2020, 12:50:49 PM »
Code: [Select]
(setq Website (strcat "https://websoilsurvey.nrcs.usda.gov/app/WebSoilSurvey.aspx?marker=(" LONG " " LAT ")"))

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Re: Pass html address through wscript
« Reply #2 on: September 22, 2020, 02:11:26 PM »
Worked!
Civil3D 2020