Visual Studio VS Code (VSCode) AutoLISP Extension: Good? Global variables report? Error trace?

Visual Studio VS Code (VSCode) AutoLISP Extension: Good? Global variables report? Error trace?

hawstom
Advocate Advocate
4,034 Views
29 Replies
Message 1 of 30

Visual Studio VS Code (VSCode) AutoLISP Extension: Good? Global variables report? Error trace?

hawstom
Advocate
Advocate

(Update: I am putting my happy commitment report in a follow-up reply and marking it as an Accepted Solution)


AutoCAD froze a couple times with the VLISP/VLIDE window open. So I thought I would use some down time to evaluate again the idea of moving from VLISP/VLIDE to Visual Studio Code (VS Code) with the AutoLISP Extension. The AutoCAD help showed me how to get up and running, set breakpoints,  step through code, and format code. But I am left with some questions before I can get to work in this environment:
1. Is anybody using the AutoLISP Extension in VS Studio for seriously large projects? (Mine has 25000 lines in 241 files including 6000 lines in the file I am most interested in working on lately.) Do any experts recommend it instead of good old VLIDE/VLISP?
2. How can I do the equivalent of "Check window" or "Check selection" with statistics (list global variables) enabled to help me manage local variable declarations?
3. How can I do the equivalent of "View error trace" when my code crashes while debugging?

4. How can I control case of various symbol classes when formatting like I can in VLIDE/VLISP?
5. How can I Rebuild FAS files for my old Visual Lisp project?

 

Thanks in advance for your expert advice, especially regarding the first question or any silver linings or workarounds!

 

Tom

0 Likes
Accepted solutions (2)
4,035 Views
29 Replies
Replies (29)
Message 2 of 30

Moshe-A
Mentor
Mentor

@hawstom  hi,

 

Our friend @paullimapa told me a few month ago that Visual VS will be replacing VLIDE but i do not find any announcement from Autodesk about it. Anyway i tried it and found it less convenient especially on debugging (AutoCAD may stack often) but if they switch to it, will have no choice 😂. mean while enjoy from what you have.

 

Moshe

 

 

Message 3 of 30

paullimapa
Mentor
Mentor

Vlide may still be offered in AutoCAD by Autodesk but since they've chosen to recommend support for VS Code with AutoLISP extension then that seems to be the future for now.

Here's a post by autodesk on how to access VLIDE features using VS Code:

https://help.autodesk.com/view/OARX/2026/ENU/?guid=GUID-30033BD2-7A43-4109-B08A-C1CFC9A7D9A5

For your reference here's the function to use to convert lsp files to fas:

AutoCAD 2026 Developer and ObjectARX Help | vlisp-compile (AutoLISP/Visual LISP IDE) | Autodesk


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

hawstom
Advocate
Advocate

@paullimapa 
Thank you.
Trace Stack: I can't get it to show anything (1) after a crash (ideal and equal to VLIDE) or (2) during execution when I expect a crash soon (less ideal). Can you? Is there any better specific help about it?
FAS: I suppose we have to create our own compilation system now using the vlisp-compile function. Is that what you did?

Tom

0 Likes
Message 5 of 30

paullimapa
Mentor
Mentor

Unfortunately, I can't comment on either of those since I don't use those features. Perhaps others that do here can provide you with better feedback.

However, if you like, you can try the attached lisp function to select and convert a lsp to fas.

 


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

hawstom
Advocate
Advocate

Thanks again, @paullimapa .
Trace: Workaround is fine (though View Error Trace is super efficient). Can you describe your process for pinpointing bugs that crash your programs?
FAS: As I mentioned, I have 241 files to compile for release updates. I suppose I will have to write or find something to do that in a batch possibly with some sort of date/modification checking. If you have any tips about that, I am all ears.

Tom
https://constructionnotesmanager.com 
https://hawsedc.com

0 Likes
Message 7 of 30

paullimapa
Mentor
Mentor
Accepted solution

You can try the attached Lsp2FasAll.lsp that prompts for you to select a folder containing multiple lsp files to convert them all to fas.

As for my process in pinpointing bugs, since my code is no where near as complicated as yours, I rely on placement of the good old fashion (alert) function along with (vl-princ-to-string) function to show me the variables in question.


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 8 of 30

Sea-Haven
Mentor
Mentor

I am like @paullimapa, I use alert a lot to see where I am up to. I don't write say 6000 lines of code and then test, rather as I use defuns in big code, just keep adding a single defun at a time making sure they are working correctly, sometimes preset variable values so can debug the defun as separate code, then paste into master code. eg 10 defuns 760 lines of code.

 

Notepad++ has a nice run selected code which is very helpful as you can test smaller sections of code. Unfortunately does not work with Bricscad.

Message 9 of 30

hawstom
Advocate
Advocate

Hah! Yeah. I've done that many times including when I was a PHP web programmer for pay around 2014 (It's good to be back in civil engineering full time). Necessity is the mother of invention, but the VLIDE features sure are nice. I grant that they may foster bad habits, though. As I get older (closing on 60 now), I find my habits improving and my "time spent with code broken" happily fading as my approach becomes more methodical and less testosterone-powered.

 

Can you think of any cool up side features of VS Studio that might balance the negatives and improve my attitude about switching? Something to compensate for my losses?

- Functions list?

- Refactoring help?

- Other?

 

Thank you very much for describing your process. It helps.

 

Tom

0 Likes
Message 10 of 30

hawstom
Advocate
Advocate

Thank you very much for describing your process. It helps.

 

Of course I don't "write, say, 6000 lines of code and then test" 😂. I confess that from 20 or 30 years ago I have some functions that are longer than I would prefer. But mostly the files get long and it's hard to remember how anything works after 10 or 30 years. So the VLIDE features are very nice.

Can you think of any cool up side features of VS Studio that might balance the negatives and improve my attitude about switching? Something to compensate for my losses?

- Functions list?

- Refactoring help?

- Other?

 

Tom

0 Likes
Message 11 of 30

paullimapa
Mentor
Mentor

There may always be wish list items you want one app should have like the other and you're welcome to use both until one becomes obselete.

But For VS Code with AutoLISP extensions installed the function list should popup on the screen just like it does in Vlide as you type but the window containing the list is a lot shorter:

paullimapa_1-1759709380811.png

 

When you've already typed out a function you can right mouse click on it and select Open Online Help:

paullimapa_0-1759709004571.png

I also like the fact that when I select something like progn all of them are highlighted:

paullimapa_2-1759709534340.png

 

There are many others too but you'll have to experience them as you work on the app


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

hawstom
Advocate
Advocate

1. Function list should popup? In VLIDE and VS Code? Really? I see this in VS Code, but I never saw it in VLIDE. What was I doing wrong all these years? This is not a rhetorical question. I would like to be able to see a function list popup when/if I return to VLIDE.
2. I am so new at this that I don't even know the right search terms. What would I search (for example, VS Code or the AutoLISP Extension) to find out whether I can audit my local variable declarations or view the last stack after a crash?

3. I am not demanding equal behavior. I am just looking for a silver lining since View Error Trace would be a HUGE thing to lose. Is there any consolation you personally see in moving to VS Code other than "it's the way of the future"? Anything that makes you grin when you think that you are using VS Code instead of VLIDE?

4. How do you "use both"? Do you keep two versions of AutoCAD active so that you can have LISPSYS different in each?

 

Tom



0 Likes
Message 13 of 30

paullimapa
Mentor
Mentor

For Vlide's popup window function list I'm referring to the Apropos Feature which you can read about here:

https://help.autodesk.com/view/OARX/2024/ENU/?guid=GUID-34F9562B-E4F3-47D3-92D8-9EF79623E9C7

 

I really like for VS Code the ability to open the same lisp file in multiple windows. Now I can see different sections of the code for editing without having to manually jump from one location to another and then find the way back.

 

Unfortunately LISPSYS needs to be set and requires a restart 

and even if you can run differently for different sessions, the debug process in VS Code won't be able to differentiate which session of Autocad to use

 


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

hawstom
Advocate
Advocate

@paullimapa 
Thank you very much ❤️

This is what I hoped to get.


I would have not just different sessions, but different versions, like 2025 and 2026. 😄 That's something I really may do. That would free me to experiment without feeling robbed.

 

Tom

0 Likes
Message 15 of 30

paullimapa
Mentor
Mentor

You are welcome and enjoy your explorations…cheers!!!


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

hawstom
Advocate
Advocate

To wrap this up for the moment, I am going to accept my own reply here as the solution with a pointer to the discussion above. Refer to multiple replies above, especially by @paullimapa, mentioning how to access some VLIDE features, commiserating about what's lost (chiefly View Error Trace), giving workarounds for rebuilding FAS, sharing some silver linings about moving to VS Code, and talking about the feasibility and methods of running both during transition or testing. And here is a bonus link to a workaround by @john_uhden for listing globals

0 Likes
Message 17 of 30

paullimapa
Mentor
Mentor

Here's an AutoCAD Express Tools command for you to list current commands, functions, variables...at the command prompt enter:

LSP

Enter an option [Commands/Functions/Variables/Load]:

https://help.autodesk.com/view/ACD/2026/ENU/?guid=GUID-5B95C736-E2C4-4FC7-B623-C259A0D2F608

You can turn logfile on first and then you'll be able to see the list generated in the log text file...at the command prompt enter:

LOGFILEON

When done just turn log file off:

LOGFILEOFF

https://help.autodesk.com/view/ACD/2026/ENU/?guid=GUID-2FB60E75-7926-4344-91DC-B2A1D9F52163

 


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

hawstom
Advocate
Advocate

Oh, nice. I have never used either of those.

0 Likes
Message 19 of 30

DGCSCAD
Advisor
Advisor

Paul's suggestion using LSP is how I track down variables, since I use regular old Notepad. The rogue variables are usually between ACZOOMSCALEDRELATIVEPSPACE and VLAX-VBABORT (AC2018) with a few at the very end of the list. Make sure to leave the necessary default AutoCAD ones alone, i.e. T, Pi, and PAUSE, etc..

AutoCad 2018 (full)
Win 11 Pro
Message 20 of 30

BlackBox_
Advisor
Advisor

My only real 'issue' with switching from VLIDE is that Autodesk still requires the use of a second IDE, when most LISP developers that graduated to .NET API are already using full Visual Studio (not VS Code). Yes, VS Code supports .NET languages too, but VS Code != full Visual Studio. 

 

If they could make a LISP extension for VS Code, then I wish they would have made it work with full Visual Studio, so we'd only need a single external IDE. 


"How we think determines what we do, and what we do determines what we get."

Chris (BlackBox) Bradley
Managing Partner / Developer / Civil Designer
Quux Software | Sincpac C3D | Style Explorer