Jump to content

Recommended Posts

Posted

Hi,
Is it possible to make API (web) calls using AutoLISP that work in both AutoCAD and AutoCAD LT?
If not, what is the recommended workaround for AutoCAD LT?

Thanks in advance!

Posted (edited)

Hi
I guess a necessary question is: which API calls?

If you want to access the web, look for information about XMLHTTP

Edited by GLAVCVS
Posted (edited)

Do a google lots of code out there can be as simple as.

 

(command "browser" "https://maps.google.com.au" )

; opera house -33.8567844,151.213108,17z

(command "browser" "https://www.google.com.au/maps/@-33.8567844,151.213108,17z")

Not tested in LT. Works in Bricscad.

Edited by BIGAL
  • Like 1
Posted
On 6/26/2025 at 3:18 PM, GLAVCVS said:

Hi
I guess a necessary question is: which API calls?

If you want to access the web, look for information about XMLHTTP

 

  (setq webObj (vlax-invoke-method (vlax-get-acad-object) 'GetInterfaceObject "WinHttp.WinHttpRequest.5.1"))
  (vlax-invoke-method webObj 'Open "GET" strUrl :vlax-false)
  (setq errobj (vl-catch-all-apply 'vlax-invoke-method (list webObj 'Send)))

This code not working in AutoCAD LT. 

Posted (edited)
48 minutes ago, p7q said:

 

  (setq webObj (vlax-invoke-method (vlax-get-acad-object) 'GetInterfaceObject "WinHttp.WinHttpRequest.5.1"))
  (vlax-invoke-method webObj 'Open "GET" strUrl :vlax-false)
  (setq errobj (vl-catch-all-apply 'vlax-invoke-method (list webObj 'Send)))

This code not working in AutoCAD LT. 

 

Why doesn't 'strUrl' work?

Make sure that variable contains a valid URL.

Edited by GLAVCVS
Posted

Lt may not support "GetInterfaceObject", it is not a full lisp version lots of stuff does not work.

 

@p7q did you try what I posted ?

  • Like 1
Posted
13 hours ago, BIGAL said:

Lt may not support "GetInterfaceObject", it is not a full lisp version lots of stuff does not work.

 

@p7q did you try what I posted ?

 

2 hours ago, SLW210 said:

Good stuff.

 

Here is an older example using JSON... https://github.com/diegomcas/autolisp-web-and-json-utils

 

Here is rundown on LT limitations... https://www.cadforum.cz/en/limitations-of-the-lisp-language-autolisp-visuallisp-autocad-lt-tip13683

 

IIRC you need ActiveX or other things that LT is lacking to make API calls, I hope I am proven wrong though.

 

You're both correct; LT now supports AutoLISP (not Visual LISP / COM). Not sure if it even supports Autoloader.

 

I have a customer who paid for one of my Autodesk Exchange store apps, used it for years and now his employer downgraded everyone from full AutoCAD to LT. I had offered to write a (slower but functional) Visual LISP variant of the app they purchased, but no worky. 

 

Cheers

Posted

LT does support ActiveX/COM, but cannot interface with objects outside of the AutoCAD Object Model.

  • Like 2
Posted
3 minutes ago, Lee Mac said:

LT does support ActiveX/COM, but cannot interface with objects outside of the AutoCAD Object Model.

 

Thanks for the clarification, my friend. :beer:

  • Like 1
Posted

Thanks, @Tharwat!

 

We had a child, who's about to start kindergarten in a few weeks, we've moved, we have new jobs... so my priorities are (I am) different. 

 

Cheers

  • Like 1
Posted
18 hours ago, Lee Mac said:

LT does support ActiveX/COM, but cannot interface with objects outside of the AutoCAD Object Model.

 

Good clarification.

 

From the link I posted.

 

Quote

The first type of limitation is the lack of support for external ActiveX objects. For them you cannot use the (vlax-create-object), (vlax-get-object), (vlax-get-or-create-object), (vlax-import-type-library), (vla-GetInterfaceObject) functions. These functions are typically used for online communication, clipboard handling, XML, binary files, Excel, Word, Access (or other database tools), etc. But there may be a workaround for your situation - see the Tip 14007.

 

 

 TIP 14007 

Posted (edited)

What is obvious is that non of the responders probably have a LT2024+.

 

So again to @p7q can you copy this one line to the command line of your LT and let us know if it works. It may only open a web site but may be useful.

(command "browser" "https://maps.google.com.au" )

 

As a part time user of Powershell that may be one way around the API call as does LT allow for "Shell" ie open a bat file.

 

Another test should open Notepad.

(command "shell" "Notepad")

The more tests you do for us the more we may be able to help.

Edited by BIGAL
  • Agree 1
Posted

Also, if you are using AutoCAD 2024LT or AutoCAD 2024, there is built-in function as I mentioned, and you can use it, and you will get something like this (picture 1).

 

image.thumb.png.1f5b1966dca933c9b7336686ac4922a1.png

Picture 1.  showhtmlmodalwindow

Posted
On 6/28/2025 at 3:32 AM, Saxlle said:

You can also try with showhtmlmodalwindow

 

Wish this were modeless instead of modal, so you could switch between them. 

 

Browser command, and startapp + explorer + url work fine. 

 

Webload command is really neat, but most don't do Javascript/HTML. 

 

  • Agree 1
Posted
6 minutes ago, BlackBox said:

Wish this were modeless instead of modal, so you could switch between them. 

Agree with this, it would be great.

Posted
7 hours ago, BIGAL said:

What is obvious is that non of the responders probably have a LT2024+.

FWIW, neither my ADN nor work's AEC Collection subscriptions give me access to LT (full versions only). 

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...