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

🔊 - Whats your thoughts on AutoLISP in AutoCAD LT 2024?

146 REPLIES 146
Reply
Message 1 of 147
handjonathan
18589 Views, 146 Replies

🔊 - Whats your thoughts on AutoLISP in AutoCAD LT 2024?

Hello, AutoCAD community,

 

The AutoCAD team wants to hear your impressions of AutoLISP, specifically around its availability in the 2024 release of AutoCAD LT.

 

Which routines are you most excited to use? Let us know in the comments below!



Jonathan Hand


Industry Community Manager | AEC (Architecture & Building)

146 REPLIES 146
Message 41 of 147
scot-65
in reply to: handjonathan

Jonathan,

 

It would be nice to outline what functions work and those that do not.

Lisp, ACET, VL, VLA, VLAX, VLR, etc.

Access to the registry and dictionaries.

 

We do not use .net here.

We do not bundle (though it is a thought).

I do not use the built in editor for LSP or DCL.

I would like to be able to FAS some of my work.

 

Half of my library involves editing and the other half creating objects.

Programming started back with Release 12 (not R2012).

"Bonus Utilities" was the Express back then and I had all of that

covered with my own utilities. At last count I have over 180 developed

keyboard commands.

 

We require only a simple 2-D graphic editor, not weighed down with

texture or symbol libraries. I have developed our own "vertical"

menu system that is pretty lean as compared to what I have seen

on this forum, yet more robust than what any type of express tools

can offer - tailored to our environment to produce documents our

clients need to get thru the permit office.

 

Yes I am interested hearing more about LISP support in LT

and the price comparison to the full-on rented software that

have tools we will never use.

 


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 42 of 147

AutoLISP has been a valuable tool in the AutoCAD environment for many years, and its inclusion in AutoCAD LT 2024 is a welcome development. AutoLISP is a scripting language that allows users to automate tasks and create custom commands in AutoCAD.

Message 43 of 147

way more than a "scripting language"... but yeah.

Message 44 of 147
HE-MJJ
in reply to: handjonathan

I'm trying to get my programming working with the LT version. I've got a few commands working. But I also need to  be able to load Doslib. Do you know if this should be possible?

Message 45 of 147
vladimir_michl
in reply to: HE-MJJ

DOSlib is ARX-based, so no chance in AutoCAD LT. On the other hand, most apps are working fine without any dependency on DOSlib.

 

Vladimir Michl, www.arkance-systems.cz  -  www.cadforum.cz

 

Message 46 of 147
HE-MJJ
in reply to: vladimir_michl

That’s a shame. I really need that to work. I have about 30 files in which I use Doslib commands.
Message 47 of 147
HE-MJJ
in reply to: handjonathan

Isn't there any way this can be made possible? Or solved with a workaround?

 

https://www.screencast.com/t/D2bcqnxBm

Message 48 of 147
vladimir_michl
in reply to: HE-MJJ

I can see mostly msgbox, date functions - all this can be done also without doslib. With a little bit more overhead but compatible with future versions, without any external dependencies.

 

Vladimir Michl, www.arkance-systems.cz  -  www.cadforum.cz

 

Message 49 of 147
HE-MJJ
in reply to: handjonathan

Can you perhaps point me a function that could replace the dos_msgbox function?

Message 50 of 147
vladimir_michl
in reply to: HE-MJJ

Yes, either a DCL dialog, the (alert) function, or something like (the ":" means ":"):

 

 

 

(startapp (strcat "mshta.exe vbscript:close(CreateObject(\"WScript.Shell\").Popup(\"HELLO WORLD\",4,\"TITLE\",1))"))

 

 

 

 

Vladimir Michl, www.arkance-systems.cz  -  www.cadforum.cz

Message 51 of 147
HE-MJJ
in reply to: handjonathan

Thanks

Message 52 of 147
JamesMaeding
in reply to: HE-MJJ

I used this one for a long time, now I replace doslib with lisp functions written in .net (c#).

Note that you must have the VBA add-on installed, just realized that, so not sure if LT has that available.

BTW, acad is like $1500 a year, and bricscad pro is about 1/2 that, and both have full lisp, arx, and .net.

If a business cannot pay that, they have bigger problems than not using automation.

You may be in a situation with low revenue, or employers that spend dollars to save nickels, and that's a challenge.

 

 

;;;ConstantS
;;;vbOKOnly 0 Display OK button only. 
;;;vbOKCancel 1 Display OK and Cancel buttons. 
;;;vbAbortRetryIgnore 2 Display Abort, Retry, and Ignore buttons. 
;;;vbYesNoCancel 3 Display Yes, No, and Cancel buttons. 
;;;vbYesNo 4 Display Yes and No buttons. 
;;;vbRetryCancel 5 Display Retry and Cancel buttons. 
;;;vbCritical 16 Display Critical Message icon.  
;;;vbQuestion 32 Display Warning Query icon. 
;;;vbExclamation 48 Display Warning Message icon. 
;;;vbInformation 64 Display Information Message icon. 
;;;vbDefaultButton1 0 First button is default. 
;;;vbDefaultButton2 256 Second button is default. 
;;;vbDefaultButton3 512 Third button is default. 
;;;vbDefaultButton4 768 Fourth button is default. 
;;;vbApplicationModal 0 Application modal; the user must respond to the message box before continuing work in the current application. 
;;;vbSystemModal 4096 System modal; all applications are suspended until the user responds to the message box. 
;;;vbMsgBoxHelpButton 16384 Adds Help button to the message box 
;;;VbMsgBoxSetForeground 65536 Specifies the message box window as the foreground window 
;;;vbMsgBoxRight 524288 Text is right aligned 
;;;vbMsgBoxRtlReading 1048576 Specifies text should appear as right-to-left reading on Hebrew and Arabic systems

;(Msgbox '("Do you want to continue ?" 3 "MsgBox Demonstration" "DEMO.HLP" 1000))
;(Msgbox '("File Exists, Overwrite?" 4 "File Question" NIL NIL))
;(Msgbox '("Choose Option" 4 "File Question" NIL NIL))

(defun Msgbox (ArgLst / Msg Style Title Helpfn Ctxt oldUseri5 RetVal)
	;DO ON COMMAND LINE FOR 64 BIT SYSTEMS
	(mapcar 'set (list 'Msg 'Style 'Title 'Helpfn 'Ctxt) ArgLst)
  (setq oldUseri5 (getvar "USERI5"))
  (vla-eval
		(vlax-get-acad-object) 
    (strcat "ThisDrawing.setVariable \"USERI5\" ,CInt((MsgBox(\""
      Msg "\""
      (if Style (strcat "," (itoa Style)) "")
      (if Title (strcat ",\"" Title "\"") "")
      (if Helpfn (strcat ",\"" Helpfn "\"") "")
      (if Ctxt (strcat "," (itoa Ctxt)) "")
      ")))"
		)
  ) 
  (setq RetVal (getvar "USERI5"))
  (setvar "USERI5" oldUseri5)
  RetVal
)

 

 

that is calling the vba dialog. The top part has a few examples of its use.


internal protected virtual unsafe Human() : mostlyHarmless
I'm just here for the Shelties

Message 53 of 147

The principle is similar but the calling mechanism is different. AutoCAD LT doesn't support VBA, so you cannot use your method with 'eval'. The above 'startapp' example uses Windows mechanism to run the VBscript code, no VBA. The only problem remains the return value.

 

Vladimir Michl, www.arkance-systems.cz  -  www.cadforum.cz

 

Message 54 of 147
HE-MJJ
in reply to: handjonathan

I wouldn't want to spend my  time programming something that already might be available.

To start with... I can imagine there could already be a lisp routine out there that can replace the Doslib function 

(dos_msgbox text title button icon [duration]) I'm a bit rusty : ) I have written my lisp routines over a decade ago. 

Message 55 of 147
vladimir_michl
in reply to: HE-MJJ

Message 56 of 147
Sea-Haven
in reply to: handjonathan

Another 

 

(defun MsgBox (title buttons message time / return WshShell)
    (setq WshShell (vlax-create-object "WScript.Shell"))
    (setq return (vlax-invoke
            WshShell
            'Popup
            message
            time
            title
            (itoa buttons)
    ))
    (vlax-release-object WshShell)
    return
)
(MsgBox "Hello world!" 0 "Welcome\nthe world is still spinning\naround and around" 4)

 

You can make slides and display them also using Vslide and a delay. This way can have pretty pictures.

 

Lastly The AutoLISP Message Box | AfraLISP

Message 57 of 147
HE-MJJ
in reply to: handjonathan

The result of selecting a button in the post bu Vladimir is always 0? Then I cannot use the result with an if statement.

I do get different result values with the defun post by Sea-Haeven.

Where can I find out which value represents which buttons to be displayed?

Message 58 of 147
vmichl_cs
in reply to: HE-MJJ

Yes, the full AutoCAD's LISP can use (vlax-create-object) so the Sea-Haeven's implementation is possible. But this thread is about the LT limitations. And without that function, you cannot use this such implementation. The return value is a problem and the solution would be much more complicated.

 

Vladimir Michl, www.arkance-systems.cz  -  www.cadforum.cz

 

Message 59 of 147
HE-MJJ
in reply to: handjonathan

You are correct I guess. I'm getting "bad argument type: stringp nil" in AutoCAD LT

Message 60 of 147
HE-MJJ
in reply to: handjonathan

Why is it that the return value is a problem. Is that because it's returned from outside the lisp interpretor or something? Then maybe I need to solve it with the AutoLISP Message Box | AfraLISP option.

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

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report