p7q Posted June 26 Posted June 26 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! Quote
GLAVCVS Posted June 26 Posted June 26 (edited) Hi I guess a necessary question is: which API calls? If you want to access the web, look for information about XMLHTTP Edited June 26 by GLAVCVS Quote
BIGAL Posted June 27 Posted June 27 (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 June 27 by BIGAL 1 Quote
Saxlle Posted Saturday at 07:32 AM Posted Saturday at 07:32 AM You can also try with showhtmlmodalwindow. 1 Quote
p7q Posted Monday at 08:40 AM Author Posted Monday at 08:40 AM 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. Quote
GLAVCVS Posted Monday at 09:26 AM Posted Monday at 09:26 AM (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 Monday at 09:29 AM by GLAVCVS Quote
BIGAL Posted Tuesday at 12:03 AM Posted Tuesday at 12:03 AM 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 ? 1 Quote
SLW210 Posted Tuesday at 11:18 AM Posted Tuesday at 11:18 AM 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. Quote
BlackBox Posted Tuesday at 01:49 PM Posted Tuesday at 01:49 PM 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 Quote
Lee Mac Posted Tuesday at 04:41 PM Posted Tuesday at 04:41 PM LT does support ActiveX/COM, but cannot interface with objects outside of the AutoCAD Object Model. 2 Quote
BlackBox Posted Tuesday at 04:45 PM Posted Tuesday at 04:45 PM 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. 1 Quote
Tharwat Posted Tuesday at 05:17 PM Posted Tuesday at 05:17 PM @BlackBox I am glad to see you contributing once again in all around similar forums. It's been a long time indeed. 1 Quote
BlackBox Posted Tuesday at 05:22 PM Posted Tuesday at 05:22 PM 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 1 Quote
Tharwat Posted Tuesday at 07:09 PM Posted Tuesday at 07:09 PM @BlackBox I sent you a PM to keep this thread related to its aim. Quote
SLW210 Posted 18 hours ago Posted 18 hours ago 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 Quote
Recommended Posts
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.