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

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

handjonathan
Autodesk Autodesk
45,026 Views
146 Replies
Message 1 of 147

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

handjonathan
Autodesk
Autodesk

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


Technical Marketing Manager | Construction

0 Likes
45,027 Views
146 Replies
Replies (146)
Message 61 of 147

HE-MJJ
Advocate
Advocate

I have created replacements for the dos_msgbox and dos_msgboxex functions.

There are more doslib functions I use that need to be replaced like:

 

dos_cdate

dos_filedate

dos_mkdir

dos_dir

dos_subdir

dos_splitpath

dos_delete

dos_execute

dos_beep

dos_printers

dis_setprn

dos_attrib

dos_getfilem

dos_openp

dos_shellexe

dos_filep

dos_copy

dos_serialno

dos_computer

dos_dirp

dos_drivetype

dos_getprogress

dos_splash

dos_exewait

dos_filesize

dos_rendir

dos_rename

 

I have to look more into this but, are there replacements available for all these?

I assume dos_dir can be replaced by (vl-directory-files)

Message 62 of 147

Sea-Haven
Mentor
Mentor

Start with say the VLA equivalent, yes some have an alternative coding like serial, mkdir, rename, shell, cdate, to mention a few. Just google.

0 Likes
Message 63 of 147

HE-MJJ
Advocate
Advocate

That is my plan.

 

I assume most of the lisp functions that I created over the years will probably work under AutoCAD LT. I haven't tested them all. It would be a shame if cannot get my most important lisp function, which has a lot of the doslib functions mentioned above, to function under AutoCAD LT. I would like to know beforehand which of these do not have a vla equivalent.

0 Likes
Message 64 of 147

Sea-Haven
Mentor
Mentor

You can use windows CMD, change to your lisp directory and can run

FINDSTR dos_mkdir *.lsp

will show you every file that contains the dos_mkdir 

 

If you findstr dos_ *.lsp >doslib.txt will show every lisp that has Doslib inside, look at text file doslib.txt.

 

Google the substitute code can then copy and paste into your code a new function into multiple files.

 

Here is one example

; check that pdf directory exists
(setq dwgpre (strcat (getvar "dwgprefix") "\pdf"))
(if (= (vl-file-directory-p dwgpre) nil)
(vl-mkdir dwgpre)
)

 

 

0 Likes
Message 65 of 147

HE-MJJ
Advocate
Advocate

I noticed ( load "Julian2.lsp") isn't loading under AutoCAD LT. Strange thing is, I cannot find the file on my workstation, but under the AutoCAD full version it loads any way.

0 Likes
Message 66 of 147

JamesMaeding
Advisor
Advisor

(findfile "julian2.lsp") will tell you if found in support paths and where.


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

0 Likes
Message 67 of 147

HE-MJJ
Advocate
Advocate
Got it. Thanks!
"C:\\Program Files\\Autodesk\\AutoCAD 2024\\express\\julian.lsp"
0 Likes
Message 68 of 147

HE-MJJ
Advocate
Advocate

It seems that under AutoCAD LT my .mnl file isn't loaded along with the menu file. A.f.a.i.k. (With the AutoCAD full version) when loading the menu file the .mnl file will be loaded automatically along with it.

0 Likes
Message 69 of 147

paullimapa
Mentor
Mentor
Message 70 of 147

HE-MJJ
Advocate
Advocate

I'm looking for replacement dos_drivetype and dos_dirp.

 

Anyone?

0 Likes
Message 71 of 147

paullimapa
Mentor
Mentor

This site gives you a list of the dos_lib functions and what they do

 

paullimapa_1-1709232275954.png

 

 

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 72 of 147

paullimapa
Mentor
Mentor

For dos_dirp discussion:

https://forums.augi.com/showthread.php?123440-(vl-file-directory-p)-mistakes&p=1096863#post1096863

The closest thread I find for dos_drivetype is this which identifies cdrom (site is in another language):

http://www.mjtd.com/thread-79406-1-1.html?_dsign=dba06414

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 73 of 147

paullimapa
Mentor
Mentor

found another more clearer discussion on drivetype...see if you can figure out how modify the code to implement:

https://www.afralisp.net/archive/lisp/script1.htm

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 74 of 147

Sea-Haven
Mentor
Mentor

In Lt 2024 if Appload has a "start up suite" you may be able to add your lisps etc there to automatically load. If your doing setvars then make them a lisp.

0 Likes
Message 75 of 147

HE-MJJ
Advocate
Advocate

Found and replaced Dos_dirp with vl-file-directory-p. Thanks.

0 Likes
Message 76 of 147

HE-MJJ
Advocate
Advocate

It has been a while since I have been programming. Getting older. ; ) I'm having more difficulty to concentrate and dive into bulkes of text. I tried the first routine with "\\root\\cimv2" that resulted for me in "G:". "\\root\\cimv2" needs to be a path to our server I guess?

 

I did get DISKINFO working. Thanks for that! But I only need to get a return value (without dialogebox) wether it is a netwerk drive or not. Must be possible to figure this out with the code provided. Thanks again!

0 Likes
Message 77 of 147

HE-MJJ
Advocate
Advocate

Got it 👍

 

_$ (assoc "H" diskinfo)
("H" "H:" "H:\\" "Network drive" "NTFS" "DATA" "\\\\DATASERVER\\Projecten" "Yes" "2637144060 Kb (2514.98 Gb)" "1227919844 Kb (1171.04 Gb)" "1227919844 Kb (1171.04 Gb)")

0 Likes
Message 78 of 147

paullimapa
Mentor
Mentor

Glad to have helped…cheers!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 79 of 147

HE-MJJ
Advocate
Advocate
dos_splitpath my next challenge.
0 Likes
Message 80 of 147

paullimapa
Mentor
Mentor

That’s an easy one. I’m sure you can figure that one out. Just search for the slashes and that includes back and forward slashes 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes