Author Topic: VBA or LSP?  (Read 7514 times)

0 Members and 1 Guest are viewing this topic.

hudster

  • Gator
  • Posts: 2848
VBA or LSP?
« on: February 12, 2004, 02:25:26 PM »
I am now at the point where I need to learn how to program custom programs for my companys CAD systems.

So which should I learn VBA or LSP?

Cheers For any advice.
Revit BDS 2017, 2016, 2015, 2014, AutoCAD 2017, 2016, Navisworks 2017, 2016, BIM360 Glue

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
VBA or LSP?
« Reply #1 on: February 12, 2004, 02:29:08 PM »
I would say autolisp first. because you can get some real work done fairly quickly.
TheSwamp.org  (serving the CAD community since 2003)

daron

  • Guest
VBA or LSP?
« Reply #2 on: February 12, 2004, 02:38:27 PM »
Learn both. Give Keith, Hendie and Trev something to do.

hyposmurf

  • Guest
VBA or LSP?
« Reply #3 on: February 12, 2004, 03:58:41 PM »
Which would you suggest first though?I've started looking at LISP,looked at VBA briefly.VBA is more pop up buttons though,maybe thats why I found LISP harder as I dont see results as quickly,might go back to VBA.I realise they have different uses,such as LISP is restricted to AutoCAD where as VBA can be used in lts of other programs to,but can someone expand on what I've said,cheers.

daron

  • Guest
VBA or LSP?
« Reply #4 on: February 12, 2004, 04:09:20 PM »
Main reason to learn lisp is two-fold, all you need is a text editor to write it and most people got their start in programming, by learning it. Many of us are proficient in lisp, so it's definately a good place to start because you can get a lot of help with it. We have great vba minds here too. I'd say, decide what your needs are based on HS's post and go that route.

Spageddie

  • Guest
VBA or LSP?
« Reply #5 on: February 12, 2004, 05:10:02 PM »
8) Should really consider what it is you need to achieve....do you need to simply enhance autocad productivity (ie general cad output) or do you need to combine it with other products for output (ie exporting to Excel/Access ect)
You decision should reflect this and not which is easier to learn. 8)

TR

  • Guest
VBA or LSP?
« Reply #6 on: February 12, 2004, 05:53:22 PM »
I say VBA. Lisp is only valuable in AutoCAD, VBA is valuable throughout AutoCAD, MS Office, and a few other programs.

I'm glad I chose VBA over lisp otherwise I wouldn't have been able to do a lot of Excel programming as well as some programming with our document management system.

And daron you can code VBA in a text editor if you really want to.  :D

daron

  • Guest
VBA or LSP?
« Reply #7 on: February 12, 2004, 06:09:49 PM »
I know you can, but you can't open the compiled code in a text editor, which needs to be compiled to run. Lisp does not. That's what I meant. I just couldn't spit it out correctly.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
VBA or LSP?
« Reply #8 on: February 12, 2004, 06:10:44 PM »
Basically, LISP has been around for many many years... I believe there is a thread here somewhere detailing it's rise. Essentially the reason that LISP is the language of choice for many cad people is that all of the menus and buttons can be lisp driven without calling the vba environment. In fact, many lisp programs can be written in just a few lines of code, while the same thing in VLisp or VBA requires up to 4 times the amount of coding.

For example..
Draw a line from 0,0,0 to 0,12,0 in lisp
Code: [Select]

(defun C:LINE12()
 (command "_.line" "0,0,0" "0,12,0" "")
)


Draw the same line in VBA
Code: [Select]

Sub line12()
 Dim stpnt(2) As Double
 Dim endpnt(2) As Double
 stpnt(0) = 0#: stpnt(1) = 0#: stpnt(2) = 0#
 endpnt(0) = 0#: endpnt(1) = 12#: endpnt(2) = 0#
 ThisDrawing.ModelSpace.AddLine stpnt, endpnt
End Sub


Now there are 7 lines of code compared to 3...
notwithstanding, you ALSO must either select the VBA command from the macro window or type:
Command: -vbarun
Macro name: ThisDrawing.line12

While in the lisp version you type:
Command: line12

In a button the syntax is exactly the same as above.

Lisp is easier to learn in my opinion, AND it is much more user friendly with there being tons of resources available for lisp programmers. Also it is simple to look at and understand others code while VBA tends to be a whole lot more structured.

I say learn LISP, then when you are comfortable with lisp, particularly with customization, then delve into VBA and VB, finally ARX, C++, .NET and C#

Incedently I hear that .NET is the next "language of choice" for AutoCAD customization.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

hendie

  • Guest
VBA or LSP?
« Reply #9 on: February 13, 2004, 03:46:45 AM »
I don't think it really matters which one you start learning first. Within a short time, you are going to be looking at both. Once you start the learning process, adding another language isn't such a big deal.

I started learning Lisp but quickly started learning VBA 'cos I just couldn't bring myself to get into that morass called DCL !
So, basically, if what I propose to do stays completely within Autocad, my first choice is Lisp. If I have to communicate with any other programme I go VBA ~ it's much, much easier ! ~ and if I decide I want any kind of dialogues then I go VBA
I never said I wasn't lazy


at the end of the day the choice is yours.... bet that's helped a lot now hasn't it ?  :P

hudster

  • Gator
  • Posts: 2848
VBA or LSP?
« Reply #10 on: February 13, 2004, 06:58:58 AM »
I'm swaying more towards VBA, mainly because I want most things to be driven via dialogue boxes.

i.e. a drawing setup utility that the user selects from a set list of choices and the program does the rest.

Is it difficult to do dialogue boxes via lisp?
Revit BDS 2017, 2016, 2015, 2014, AutoCAD 2017, 2016, Navisworks 2017, 2016, BIM360 Glue

hendie

  • Guest
VBA or LSP?
« Reply #11 on: February 13, 2004, 07:19:43 AM »
Quote from: Hudster

Is it difficult to do dialogue boxes via lisp?


BWahahahahhah


splurg phnergle breep !

SMadsen

  • Guest
VBA or LSP?
« Reply #12 on: February 13, 2004, 08:23:06 AM »
Quote from: Hudster
i.e. a drawing setup utility that the user selects from a set list of choices and the program does the rest.

As for drawing setup - when it involves layouts, plotsetup, settings etc., VBA may have a slight advantage over AutoLISP. If it also involves layer setup, title blocks etc., then it may be a draw. AutoLISP is powerfull when it comes to handling entities, especially large quantities.


Quote from: Hudster
Is it difficult to do dialogue boxes via lisp?

Call me a weirdo, but I actually like doing dialog boxes in AutoLISP! Not so much DCL - that's relatively quickly over and done with - but I enjoy coding the dialogs.
You will experience it as frustating and probably jump to VBA - as have many done just because of DCL - but once over that, it can actually grow on you.

I know .. I'm a weirdo!

Anyway, learn AutoLISP and VBA. AutoLISP for the purpose of getting adesk to support this excellent tool in the future, and VBA for the reasons given by the others here. I'm ready to bet that VBA is being replaced very soon, though. ADS was abandoned after what, a few releases, after they got into bed with MS? So, if MS is saying that .NET is the future then ... well, just keep a few books on C# handy.

daron

  • Guest
VBA or LSP?
« Reply #13 on: February 13, 2004, 09:16:37 AM »
Don't forget vb.net. I'm sure they'll make a subset Application form of it to go with autocad.

SMadsen

  • Guest
VBA or LSP?
« Reply #14 on: February 13, 2004, 09:28:36 AM »
If .NET comes in flavors of both VB and C# - like ADS was available to Pascal and C - I'd definately forget about VB.NET  :)
But yes, IDE-wise it'll probably be VB.NET.