Author Topic: Any tips for using Visual Studio Code?  (Read 1652 times)

0 Members and 1 Guest are viewing this topic.

keithsCADservices

  • Newt
  • Posts: 45
Any tips for using Visual Studio Code?
« on: July 04, 2023, 08:09:01 PM »
I've barely got it setup and working. It seems to get stuck in Debug mode sometimes. I've read through this (mostly): https://help.autodesk.com/view/OARX/2023/ENU/?guid=GUID-7BE00235-5D40-4789-9E34-D57685E83875

I'm a bit confused about my JSON file and if it's even needed in the latest version of the extension. And also confused as to why/how it basically ended up in a random folder. I uninstalled and re-installed VS Code but it retains enough settings to still reference the files.

I had some issues with GstarCAD's extension changing some of the settings. It also appears that GstarCAD relies on AutoCAD's extension... I was a little disappointed to see that.

Crank

  • Water Moccasin
  • Posts: 1503
Re: Any tips for using Visual Studio Code?
« Reply #1 on: July 05, 2023, 09:30:11 AM »
I know nothing about GstarCAD.

To learn VScode with lisp you can get information here and here.
Vault Professional 2023     +     AEC Collection

keithsCADservices

  • Newt
  • Posts: 45
Re: Any tips for using Visual Studio Code?
« Reply #2 on: July 06, 2023, 10:28:49 PM »
Thank-you crank!

GstarCAD is a very AutoCAD-like program. Many of the menus appear almost identical to AutoCAD's. It has the Dynamic block functionality (but not the constrains) as well as basic 3D. Overall it's good but glitches appear here and there. The AutoLISP API seems to change version to version which alone might force me back into AutoCAD, unfortunately. Much of my code that worked flawlessly in past versions isn't working in the newer version :-(. I wish they'd just leave well enough alone!!

BIGAL

  • Swamp Rat
  • Posts: 1434
  • 40 + years of using Autocad
Re: Any tips for using Visual Studio Code?
« Reply #3 on: July 07, 2023, 11:37:58 PM »
If having problems with GstarCad look at Bricscad its pretty good in its lisp compatibility and they respond to questions with code problems. Has .net as well.
A man who never made a mistake never made anything

keithsCADservices

  • Newt
  • Posts: 45
Re: Any tips for using Visual Studio Code?
« Reply #4 on: July 08, 2023, 11:34:35 AM »
BricsCAD has similar compatibility issues (I use LISP to manipulate dynamic blocks so it's a tough task for any clone to take on). I know that for LISP I can always come here. And the developer that created BLAIDE is extremely helpful.
Unfortunately, I had so many problems with BricsCAD that every time I tried to use it I'd get zero work done; I'd go to their forum and post my problem, and get absolutely no help, like even worse that Autodesk. It was a terrible experience overall, and a huge waste of time and money. I'll never try that program again.

The issue I'm finding is that some issues get fixed version to version, but new issues appear; 1 step forward 3 steps backwards... and it just becomes a massive pain to manage. This applies to both programs. BricsCAD was absolutely not like that back in the day. It was very consistent from one release to another. Not anymore.

BIGAL

  • Swamp Rat
  • Posts: 1434
  • 40 + years of using Autocad
Re: Any tips for using Visual Studio Code?
« Reply #5 on: July 08, 2023, 07:38:29 PM »
I think you mentioned the problems you were having was with VBA not lisp. I program everything in lisp using  Bricscad checking on occasions in ACAD. I have no problems, yes there are a couple of tiny situations where Bricscad code is different. I just do a check which program is running. I know some VL functions were added after V20 but did not stop coding as you can have vla or vlax, some of the vlax was missing.
A man who never made a mistake never made anything

mhupp

  • Bull Frog
  • Posts: 250
Re: Any tips for using Visual Studio Code?
« Reply #6 on: July 08, 2023, 09:33:43 PM »
Second BIGAL I have had a very few things not work in BricsCAD over the 5 years I worked with the software. and that's just autocad to BricsCAD with out any modification. in the end i can't think of anything that i couldn't get to work. I take that back the getpropertyvalue and setpropertyvalue arn't functions in my version. and would cut out alot of code. the layer merge command had to make my own. but that might have been corrected in the newer versions.

-edit

and their are alot of things BricsCAD does that autocad seems to get messed up on. off the top of my head the way points are stored
Code - Auto/Visual Lisp: [Select]
  1. (setq pt '(x y z)) ;works in BricsCAD but will error when called in autocad
  2. (setq pt (vlax-3d-point '(x y z)) ;AutoCAD needs the vlax function for it to be treated like a point
https://www.afralisp.net/archive/methods/list/addcircle_method.htm

remember and error with polylines that are self intersecting but BricsCAD didn't have the error.

I think the biggest difference is you can run the same lisp across multiple opened drawings at the same time.
« Last Edit: July 08, 2023, 10:34:16 PM by mhupp »

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8816
  • AKA Daniel
Re: Any tips for using Visual Studio Code?
« Reply #7 on: July 09, 2023, 01:36:45 AM »
Unfortunately, Bricsys spent a ton of time building their own VLIDE, while the rest of the pack went on to use VS Code. Probably not a bad thing currently, but over time, if people start making VS Code add-ins, they’ll be missing out.

BricsCAD’s lisp engine is probably the best of the clones.. Since GsCAD & ZwCAD, are ITC members, I wonder if they share the same engine.

The current version of GRX is very similar in design to ZRX. Either they’re sharing, or GRX is a clone of a clone.
One thing I really like about GRX & ZRX, is that their respective owners eat their own dogfood, whereas BRX, once a leader, seems to be withering on the vine..

keithsCADservices

  • Newt
  • Posts: 45
Re: Any tips for using Visual Studio Code?
« Reply #8 on: July 09, 2023, 05:49:46 PM »
Quote
I think you mentioned the problems you were having was with VBA not lisp.

It was LISP but I would really have to dig to figure out what it was specifically. I'm sure the LISP code itself would be easy enough to tweak... but I promise you these were LISP issues as I've never touched VBA (in CAD at least) in my life.

In all honesty, if I simply had to tweak my code to work with BricsCAD, but the rest of the program worked just fine, I would have been okay with that. There were so many other issues. I believe many of the issues I had were introduced in later versions of BricsCAD, so it's possible that people working in older versions never experienced them, hence our differing opinions.
One huge issue which I now recall as I'm typing this out was that the "FILEDIA" (or a similar variable) would constantly change as I was debugging my LISP. Issues like this often seemed to be the user's problem... So I guess while I figure out a way to blame myself for it happening, I also have to sort out the mystery as to why it never occurred, not once, in ACAD nor GStarCAD  :2funny:
Unfortunately it was one thing after another. Aside from the more critical flaws, there were lots of small flaws: The bar on top of the screen was stuck as being white (severely clashing with the program's dark theme). At least one error message was appearing in the command line at startup... this being out-of-the-box without me causing it. The program also forced me to make any/all file types associated with BricsCAD even though I selected the option not to... to be honest that part was downright scary.
For reference I was using the '21 version (I think... something around there).

BLAIDE actually worked really good. It has some focus issues but the developer was right on top of it; he seems very dedicated. He is also the one that is most active in the BricsCAD forum. BLAIDE is basically just a better version of AutoCAD's VLIDE. In my opinion, BLAIDE is a better tool that VS Code, at least for LISP. My overall experience with BLAIDE is in complete contrast to anything listed above. Only good things to say!

Quote
Unfortunately, Bricsys spent a ton of time building their own VLIDE

In reality it wasn't that much time nor very resource intensive. Where their resources were actually tied up was probably the BIM and Mechanical versions of their program. It seems like the appearance of those programs coincides with some of the bugs listed above. A debugger on it's own isn't much work (well it is for one guy so credit where credit due) but in the grand scheme of things, it's far from a brutal resource-sucking endeavor.

Quote
Since GsCAD & ZwCAD, are ITC members, I wonder if they share the same engine

GstarCAD used to be an ITC member. They built their own CAD from scratch.

Quote
The current version of GRX is very similar in design to ZRX. Either they’re sharing, or GRX is a clone of a clone.

That would be interesting!

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8816
  • AKA Daniel
Re: Any tips for using Visual Studio Code?
« Reply #9 on: July 09, 2023, 06:18:03 PM »
The bar on top of the screen was stuck as being white (severely clashing with the program's dark theme).

I agree about the menu bar is ugly, so I made a BRX plug in to change it  :laugh:
https://www.theswamp.org/index.php?topic=57904.0

keithsCADservices

  • Newt
  • Posts: 45
Re: Any tips for using Visual Studio Code?
« Reply #10 on: July 10, 2023, 11:32:56 AM »
https://www.theswamp.org/index.php?topic=57904.0

Thanks for doing that! The UI in BricsCAD actually looks really good. But having that white title bar at the top kind of ruined it. This seems to be a common theme with lots of modern programs: Things almost work but then they ruin it with one little thing they could have (relatively) easily fixed.

The menu bar issue made me especially upset because someone on the BricsCAD forum explicitly stated that it HAD TO be like that because of Windows. I knew they were completely full of it. But still... its frustrating.

JohnK

  • Administrator
  • Seagull
  • Posts: 10663
Re: Any tips for using Visual Studio Code?
« Reply #11 on: July 10, 2023, 02:02:07 PM »
VSCode:
I create my own JSON files and store them in the project directory. This is sort of rubs against the grain of my programing brain because if/when you update AutoCAD you'd have to change these JSON files in each project (I think), but I thought it would be better to have the config file in the case I didn't have it later (because then I'd have to google how to make one). Also, I found the JSON file a bit contradictory for the `attach` and `launch` directives; in that, I didn't need a path for the `attach` setting but I did for the `launch` (both should just detect the running instance, but I can see the logic for `launch` not doing that by default too).

Here is how I program for AutoLisp:
https://www.theswamp.org/index.php?topic=55696.msg598040#msg598040

Background:
I like to program for my UNIX server mainly in my free time (that's unix so I'm doing C/C++ in my editor and using Makefiles and/or build systems).

I also like to program for AutoCAD (what I do for a living); I still use my text editor (Vim) on Windows for the majority of my programming needs but I use VSCode for debugging and whatnot.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

keithsCADservices

  • Newt
  • Posts: 45
Re: Any tips for using Visual Studio Code?
« Reply #12 on: July 12, 2023, 07:11:22 PM »
Thanks for sharing all of that John!

My LISP is never complex enough (or was really never complex enough) to need to create separate projects. Although I probably would have still benefitted from it. I'm pretty naïve when it comes to managing projects for LISP. In fact, even in C#... but it's something I'd better get used to if I want to be worth the clothes on my back when it comes to the .NET programming.

I guess each project/file location will have it's own separate JSON file?

Back in the day I just started cranking out code in VLIDE without even knowing all the features available. I kind of liked (and grew accustomed) to that: Learning as you go. All the prep work involved is a bit of a pain. I really wish they just made a better VLIDE. Or even just Visual Studio - there's obviously much more to learn but I find it to be a little more intuitive.


jlogan02

  • Bull Frog
  • Posts: 327
Re: Any tips for using Visual Studio Code?
« Reply #13 on: July 19, 2023, 12:22:05 PM »
I think it's just me, but debugging in VS for lisp seems infinitely easier.


I also like to program for AutoCAD (what I do for a living); I still use my text editor (Vim) on Windows for the majority of my programming needs but I use VSCode for debugging and whatnot.
J. Logan
ACAD 2018

I am one with the Force and the Force is with me.
AutoCAD Map 2018 Windows 10