Author Topic: From which program should I start coding in the Autocad program? Autolisp or c#  (Read 1145 times)

0 Members and 1 Guest are viewing this topic.

zall

  • Mosquito
  • Posts: 1
Hello everyone! I am new user from this forum. May be this topic asked  by another person but i didn't find any answer for the starting to coding for autocad. Now i am learning autolisp. However i am a bit confused. In the future does Autolisp enough for making big programs or should i learn to c#.

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
My professor in college 20 years ago told me to learn C#... he knew that was the future.  I waited 10 years to listen to him.  I hate myself for that.

On the flip side, Autolisp got me through until then, but C# .net expanded my efficiency / capabilities / opportunities 10 fold.  The language is universal... it can help you work with Autocad's API, customize Unity, build windows and phone applications, and so much more.

Peter2

  • Swamp Rat
  • Posts: 619
The question you need to answer is: What is your target in programming?

"Big programs" (as mentioned, 100s or 1000s of working hour): C# should be better
"Tools from 2-liners upwards, running with same code and uncompiled in old and new versions and in AutoCAD and Bricscad, modified in a few minutes": try Lisp.

But when you search the internet for the same topic, you will found many discussions there.
Peter

AutoCAD Map 3D 2018 German (so some technical terms will be badly retranslated to English)
BricsCAD V21

MickD

  • Gator
  • Posts: 3478
  • (x-in)->[process]->(y-out)
For _big_ applications, yes, C# would be the best bet BUT....and this is a big 'but', you will have very little productivity for a long time (particularly if you are new to programming!).

To get immediate results and productivity in your day to day work it's hard to go past AutoLISP, that's what it is for! Just start making small routines to automate your tedious tasks, keep building on that base and you will soon have a good library of tools AND a much better understanding of how AutoCAD works (this is key!).
There is very little you can not get done with AutoLISP and there is Terabytes of sample code out there (just look at the size of the AutoLISP board here at The Swamp!)

I'm assuming you are relatively new to programming so there are some basics you need to learn such as:
- what are variables and scope
- data structures
- conditional branching
- loops and recursion
- functions
- how to use libraries
- how to structure an application or library
- etc. etc...

Lisp as a language is one of the simplest languages to learn, it is elegant in that it has very little syntax ('everything' is a list!) and writing code is done by writing to a text file in a simple text editor. This makes learning the above a lot easier to do as you don't have the extra cognitive load of learning how to use IDE's, wiring up correct frameworks/API's, OOP programming paradigms et al.
In earlier days there was VB/A which also had a low barrier of entry into the programming/automation world and was a lot easier to 'level up' from (to say C#) but it is not really viable these days.

A few months/years learning programming with lisp first would not be altogether wasted even if your goal is to learn a more 'imperative' style language and on top of that you'll be a lot more productive a lot quicker!

Programming is a very long term mission/goal/obsession so if you are in a hurry to get stuff done AND learn how to write programs then I'd dive into AutoLISP. If you go the C# route be prepared for a steep learning curve and to learn next to nothing about programming AutoCAD 'productively' for many weeks->months (you need to learn the language and tools first) but the choice is ultimately yours :)

Good luck!
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: To attain knowledge, add things
every day; to obtain wisdom, remove things every day.

Jeff_M

  • King Gator
  • Posts: 4012
  • C3D user & customizer
What MickD said. When I first saw the OP message yesterday I was going to compose something similar to Mick's, except it would've been half as long and 25% as concise, so I'm glad I waited until today to come back to it.

Well said, MickD!

MickD

  • Gator
  • Posts: 3478
  • (x-in)->[process]->(y-out)
Thanks Jeff :)
Forth is like the Tao: it is a Way, and is realized when followed.
Its fragility is its strength; its simplicity is its direction - Michael Ham

Lao Tzu: To attain knowledge, add things
every day; to obtain wisdom, remove things every day.

dgorsman

  • Water Moccasin
  • Posts: 2434
And another +1.  With LISP you can get into AutoCAD immediately.  With C# it's best to forget about AutoCAD for a while, and learn the concepts and use of Visual Studio (and source management such as GitHub) before tackling a practical implementation.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 7066
  • AKA Daniel
Doesn't everyone start with lisp?
Retired

nobody

  • Swamp Rat
  • Posts: 861
  • .net stuff
Alternately you really want to go crazy learn golang... pretty sure its the future in 20
Years

BIGAL

  • Swamp Rat
  • Posts: 777
  • 30 + years of using Autocad
just downloaded a new version of a 3rd party Autocad its 645Mb in size that's multiple programmers, etc compared to one of my packages 345 files 22Mb 123 dwg's, 109 lisps, slides and more.
A man who never made a mistake never made anything