Author Topic: Lisp e BROSWER command  (Read 1429 times)

0 Members and 1 Guest are viewing this topic.

Lupo76

  • Bull Frog
  • Posts: 343
Lisp e BROSWER command
« on: June 14, 2016, 09:14:07 AM »
Hello to all,
I have a problem with AutoCAD 2011 (and some or all later versions).
While in BricsCAD V16 it is working properly.

The function (command "_.broswer" link), truncates the link after 132 characters.

I encountered this problem in some of my clients pc.
Now I can reproduce it in Win7 (32 bit) + AutoCAD2011 (32-bit).

isit AutoCAD limit?
Is there another way to open a link in the default broswer?

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Lisp e BROSWER command
« Reply #1 on: June 14, 2016, 09:16:53 AM »
You could shorten your link like so.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

ChrisCarlson

  • Guest
Re: Lisp e BROSWER command
« Reply #2 on: June 14, 2016, 09:55:39 AM »
I'd limit the amount of characters.

132 is a decently standard maximum character length.

Lee Mac

  • Seagull
  • Posts: 12922
  • London, England
Re: Lisp e BROSWER command
« Reply #3 on: June 14, 2016, 10:07:09 AM »
This thread may offer some alternatives:
https://www.theswamp.org/index.php?topic=44768.0;

Lupo76

  • Bull Frog
  • Posts: 343
Re: Lisp e BROSWER command
« Reply #4 on: June 14, 2016, 12:32:53 PM »
This thread may offer some alternatives:
https://www.theswamp.org/index.php?topic=44768.0;

Perfect! thanks!
This is the solution that I preferred:
Code: [Select]
(defun openbrowser (path / exe)
  (if (and
        (setq exe (vl-registry-read "HKEY_CLASSES_ROOT\\.htm" ""))
        (setq exe (vl-registry-read (strcat "HKEY_CLASSES_ROOT\\" exe "\\shell\\open\\command" "")))
        (wcmatch exe "\"*\"*")
        (setq exe (substr exe 2 (1- (vl-string-search "\"" exe 1))))
        (setq exe (findfile exe))
      )
     (startapp exe path)
   )
)

I hope it will work for several years ....