Jump to content

Open Browser


Travaci

Recommended Posts

Hi, i want to open google website & search something with autolisp. İs this possible ? 
(startapp "explorer" "www.google.com") & next?

Link to comment
Share on other sites

Hi @Travaci

 

You can do it like this:

(defun wsite (/ thisdrawing)
 (setq thisdrawing (vla-get-activedocument (vlax-get-acad-object)))
 (vla-SendCommand thisdrawing (strcat "_browser" " " "https://www.cadtutor.net/forum/forum/15-autolisp-visual-lisp-amp-dcl/" " ")) --> this is example for link after "https://...."
 (princ)
)

 

Another way (picture 1):

- Type in AutoCAD: ALIASEDIT

- Go to "Shell Commands"

- Click Add Button

- Enter the Alias (if you use for e.g. CHROME): GOOGLE

- Command: START CHROME

- Click OK, Apply, ...

- After everything are saved, type GOOGLE to run CHROME.

 

image.png.edcdeeec7c8cc4765bd6734ab0994e93.png

 

Best regards.

Edited by Saxlle
Link to comment
Share on other sites

This one works on my system:

(command "shell" "chrome https://www.nhm.ac.uk/discover/dino-directory/name/name-az-all.html")

The "explorer" opens the windows explorer.

  • Like 2
Link to comment
Share on other sites

Why does everyone give the same answer. i say, i want to search something in google.
 

Link to comment
Share on other sites

1 hour ago, Travaci said:

i want to search in google 

As i described to you on the picture 1, if you are using other Browser for search (Chrome, Edge, Firefox, Opera,....) change this two steps:

1. Enter the Alias (if you use for e.g. Firefox, Opera, Edge,....): "Put any name which you want" (it will be like command, for e.g. you use PLINE for polyline)

2. Command: START "Put the name of BROWSER" (Opera, Firefox,....).

- Click OK, Apply, ...

- After everything are saved, type "Name which you put for Alias" to start desired Browser inside AutoCAD.

 

Link to comment
Share on other sites

Already i can open chrome with (startapp "explorer" "www.google.com"). İts default browser. 
Than i want to search something in google.

 

Link to comment
Share on other sites

5 minutes ago, Travaci said:

Why does everyone give the same answer. i say, i want to search something in google.
 

If you want to use "some lisp" while "command is active after running a lisp and you want to search something in browser", i think it is hard to be done or even impossible to do.

Link to comment
Share on other sites

So for the actual searching..

 

You need to open the browser - I don't think AutoCAD integrates with Google (other search engines are available), and from there do the search

 

Fuccaros method works to open the browser:

(command "shell" "start microsoft-edge:http://google.com")

 

Change microsoft-edge to your browser.

 

For a search and you can check this open your browser and search for something, or nothing, and look at the page tag at the top and this is the text to put in instead of http://google.com

 

For example, try this:

(command "shell" "start microsoft-edge:http://google.com/search?q=Something+or+nothing")

 

I don't know your LISP abilities so ask if you need help. I'd get your search terms (above, 'something or nothing') and strcat them together with a '+' in between to make the search string, append that to (command "shell" "start microsoft-edge:http://google.com/search?q= , finish with a closing bracket ) and you should have something that works.

 

You can off course change google to any website:

 

(command "shell" "start microsoft-edge:https://www.cadtutor.net/forum/topic/92132-open-browser")

 

Link to comment
Share on other sites

and this is a quick LISP... no checking and can be neater,

 

(defun c:openpage ( / SearchTerm PageBase)


  (setq SreachTerm (getstring "Enter Serch Term: [use '+' between terms] ")) ;; get search term, '+' between words


  (setq PageBase "(command \"shell\" \"start microsoft-edge:http://google.com/search?q=") ;; google address
  (setq Page (strcat PageBase SearchTerm "\")" )) ;; google + search term address
  (eval (read Page)) ;; open 'Page'
)

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...