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

Open and HTML from autocad

7 REPLIES 7
Reply
Message 1 of 8
lisaj98052
1760 Views, 7 Replies

Open and HTML from autocad

Hi, I have been tring to open a html file from an toolbar button and darn! if I just cant get it to work. Thought I could use the following; (command "_.browser" "l:/CAD Web/Display/cadweb.html") but all I get is an empty page. Any clues as to how I can get this to work, thank any help is appreciated greatly.
7 REPLIES 7
Message 2 of 8
hmsilva
in reply to: lisaj98052


@lisaj98052 wrote:
Hi, I have been tring to open a html file from an toolbar button and darn! if I just cant get it to work. Thought I could use the following; (command "_.browser" "l:/CAD Web/Display/cadweb.html") but all I get is an empty page. Any clues as to how I can get this to work, thank any help is appreciated greatly.

Try

(startapp
"C:\\Program files\\Internet Explorer\\iexplore.exe"
"l:\\CAD Web\\Display\\cadweb.html")

 

HTH

Henrique

EESignature

Message 3 of 8
lisaj98052
in reply to: hmsilva

OMG! That worked great, I'm so happy.........Thank you very much my fustration cloud has been lifted
Message 4 of 8
Lee_Mac
in reply to: lisaj98052

Alternatively:

 

(startapp "explorer" "l:\\CAD Web\\Display\\cadweb.html")

 

Will open the file using the default program assigned to the .html extension.

Message 5 of 8
hmsilva
in reply to: lisaj98052

You're welcome, lisaj98052
glad i could help

Henrique

EESignature

Message 6 of 8
lisaj98052
in reply to: lisaj98052

Oh spock to soon, when I put that into my tool bar is does not work, I just get (startapp "c: It works if I place this in the keyin but not if its in a toolbar
Message 7 of 8
Lee_Mac
in reply to: lisaj98052

One more, to open the file using the default browser:

 

(defun defaultbrowser ( url / exe )
    (if (setq exe (vl-registry-read "HKEY_CURRENT_USER\\Software\\Classes\\http\\shell\\open\\command"))
        (startapp (vl-string-subst url "%1" exe))
    )
)

 

Call with

 

(defaultbrowser "l:\\CAD Web\\Display\\cadweb.html")

 

Message 8 of 8
Lee_Mac
in reply to: lisaj98052

lisaj98052 wrote:
Oh spock to soon, when I put that into my tool bar is does not work, I just get (startapp "c: It works if I place this in the keyin but not if its in a toolbar

 

If you want to use the code directly as the macro for a toolbar button, you will need to substitute (chr 92) for the use of a backslash, as the backslash is a macro operator representing a pause for user input:

 

(defaultbrowser (strcat "l:" (chr 92) "CAD Web" (chr 92) "Display" (chr 92) "cadweb.html"))

 

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

Post to forums  

Autodesk Design & Make Report

”Boost