tzframpton Posted November 24, 2009 Posted November 24, 2009 **I posted this first over at TheSwamp.org. Just thought I'd expand my question to get it answered on multiple forums so for those that do go to both forums, sorry for the duplicate** I recently came across a PDF eBook titled "Visual LISP Guide: AutoCAD 14" and it has a print date of April 23, 1998 and is 517 pages long and looks to be pretty in depth. A few questions: Would this be a good source of learning even though it's coming on 12 years old? If the above question is "yes" then here are some more: Is there a distinction between AutoLISP, Visual LISP, and VBA or am I just missing the term meaning? I know that since AutoCAD 2010, VBA does not come installed. Is VBA going away and should I start learning another language? Most of you guys should know that I know how to open and monkey around with existing code. I have even written a few very small custom LISP programs for myself, the biggest one done all by me was probably 6 lines. I am at a point where I really need to start getting more familiar with custom programming to further extend my skills for my company instead of relying on taking what has been written and trying to fit it in. If I print this book (plus two others I have) and bind them, keep them on my desk, then in my freetime I can try and run through them. Any comments for me and what I should do? Quote
rkmcswain Posted November 24, 2009 Posted November 24, 2009 a) Autolisp is the core lisp language for AutoCAD. It's all we had up until R14. b) Visual Lisp is nothing more than an extension to Autolisp. Autodesk bought (if you can imagine that...) an existing program called Vital Lisp, integrated it into AutoCAD, and named it Visual Lisp. c) VBA belongs to Microsoft, and it had been dead for a few years now. Having knowledge of "VB" is not a bad thing, because it can be put to use with VB.NET. But, among all the other choices available today, VBA would be the last thing to use for a robust, scalable AutoCAD application. Note also that VBA in 64-bit is only possible because Autodesk supplies a wrapper for it, and it slows down your entire AutoCAD system by about 10X when loaded. d) If you are working with verticals and their API, then .NET or ObjectARX may be your best option. You can still do some things with vertical API's in lisp, but not always. BTW: I have not seen that book I don't think, but I'm sure it's still good for the most part. The first two links here are to some good stuff: http://cadpanacea.com/node/111 Quote
JohnM Posted November 24, 2009 Posted November 24, 2009 Autolisp is regular lisp language that AutoCAD wrote particular functions to integrate into AutoCAD. Visual lisp is an extension of autolisp that allows the programmer to access visual basic functions. VBA more than likely will be discontinued but the access through visual lisp will remain. If you want to get deep inside AutoCAD C++ is the way to go but there is a long learning curve. There you can create your own objects and do all kinds of nasty things. In my opinion any information is a big help. There are a lot of old tips and tricks out there, so the more you read the more you will be able to understand. Although you can read a million books the best way to learn is to think of a program and start writing it then when you get stuck go find the answer either in forums like this or in books. You will quickly find that there are many ways to write the same code and some will fit better for your application than others. When I go back to my first programs and go over them I think about how muck better I could write them now. The longer you program and the more complex your programs become the more you will learn. One thing I try to stress to beginners is to make a lot of comments in your code. I know it’s a pain but trust me 6 months later when you go back to it you will be glad you did. Another big issue is getting in the habit of localizing variables. This will solve a ton of conflict issues down the road. If you look through this forum at the code that has been poster you will find that a lot of it does not have the variables localized. If you start good programming habits early it will serve you well because old habits are hard to break. Quote
tzframpton Posted November 24, 2009 Author Posted November 24, 2009 McSwain, thanks for the detailed answer. Here's my situation: I run AutoCAD MEP and I do want to know programming language(s) related to the vertical products. However, recently we have upgraded five LT licenses to two full and three MEP licenses. Now that we are converting everyone to a full version, and now that good 'ol fashioned Tool Palettes have run it's course I want another task to conquer for even more efficiency in my office. The reason is because most of the time we're just providing 2D shop drawings since we're a mechanical contractor and don't need to use vertical products unless needed. But it's just little things that my guys ask me, like very simple repetitive tasks that I should easily be able to quickly write up to make things easier for everyone. That's why I'm inquiring about all this. Any other books you could recommend for my situation?? :wink: Quote
Freerefill Posted November 25, 2009 Posted November 25, 2009 There are three things that helped me immensely when learning AutoLISP and Visual LISP. The first is Jeff Sanders' site. It has a lot of tutorials and really good, easy-to-read explanations of the most common commands and functions. http://www.jefferypsanders.com/autolisp.html The second is this forum. The learning curve was steep as bloody hell *shakes fist at Lee* but it was worth it. The third is, believe it or not, the AutoCAD LISP help files. They're a very easy to access source for all (or most of) the functions at your fingertips. I still to this day use them, if I ever needed to look up the right Visual LISP function or if I forget a syntax. Spend a half hour each day just reading each one and its description. You don't need to commit anything to memory; the time will come when you have a need, and you'll feel something gnawing away in the back of your memory. That's when you fire up the help files and browse until you find it. Just my two cents. Quote
jalucerol Posted November 25, 2009 Posted November 25, 2009 The third is, believe it or not, the AutoCAD LISP help files. They're a very easy to access source for all (or most of) the functions at your fingertips. I still to this day use them, if I ever needed to look up the right Visual LISP function or if I forget a syntax. Spend a half hour each day just reading each one and its description. You don't need to commit anything to memory; the time will come when you have a need, and you'll feel something gnawing away in the back of your memory. That's when you fire up the help files and browse until you find it. This is the main source of knowledge, IMHO. Quote
alanjt Posted November 25, 2009 Posted November 25, 2009 I would defiantly have the Autocad 2000 AutoLisp Reference and the Visual Lisp Developer's Bible. Too big to post, but I'll gladly email them both to you. Quote
tzframpton Posted November 25, 2009 Author Posted November 25, 2009 I would defiantly have the Autocad 2000 AutoLisp Reference and the Visual Lisp Developer's Bible. Too big to post, but I'll gladly email them both to you. Alan, PM sent. Thanks to everyone else for the references. I have been looking through AutoCAD Developer Help and have used it many times before just to poke around with it. Also, some good news: My best friend who is also my gym partner is a very good PHP, MySQL, and Java programmer told me last night that the lead programmer at his design firm knows AutoLISP, VisualLISP, VBA, and .NET extremely well. I've hung out with him a few times actually so I messaged him on Facebook and he said he'd gladly sit down with me and give me a crash course. Thank God. I just wish I had someone in my office more knowledgeable than me to learn from. Unfortunately, I'm the "guru" so it doesn't get any better than me. Hopefully Sam can explain some things for me to get me kicked off. I've already started to print out and scan over some code. I think my first project is to create a Supply, Return, and Exhaust HVAC symbol and create a block. That would actually be a useful program, and I'll just go from there. Quote
alanjt Posted November 25, 2009 Posted November 25, 2009 Email on the way. I've also added a few other useful goodies. Lisp is a most valuable language for CAD users. I will never abandon it. I can't tell you how many times I've spent 5-10 minutes writing out a bit of code in Lisp to perform a specific function that saves me hours upon hours of time. Hell, I may never use that function again, but it saved me and my colleagues a ton of time that day. That's the biggest reason I use so many subroutines in my code, I can quickly code something out because half of the functions I've already prepared. A lot of my code is written at home or at work, without a deadline, but a lot of it is written on the fly, to save myself. Lisp will (hopefully) never die because of it's ease to learn, versatility that's only (for the most part) hindered by the coder's own programming ability and ability to turn 5 minutes and 10 lines of code into hours of time saved. Sadly, Lisp can't do it all anymore, but it can still do a lot. I'm working on learning VB.Net to ensure I can code for Civil 3D, but I'll never abandon the use of Lisp as a programming language for AutoCAD. Quote
tzframpton Posted November 25, 2009 Author Posted November 25, 2009 Email on the way. I've also added a few other useful goodies. Lisp is a most valuable language for CAD users. I will never abandon it. I can't tell you how many times I've spent 5-10 minutes writing out a bit of code in Lisp to perform a specific function that saves me hours upon hours of time. Hell, I may never use that function again, but it saved me and my colleagues a ton of time that day. That's the biggest reason I use so many subroutines in my code, I can quickly code something out because half of the functions I've already prepared. A lot of my code is written at home or at work, without a deadline, but a lot of it is written on the fly, to save myself. Lisp will (hopefully) never die because of it's ease to learn, versatility that's only (for the most part) hindered by the coder's own programming ability and ability to turn 5 minutes and 10 lines of code into hours of time saved. Sadly, Lisp can't do it all anymore, but it can still do a lot. I'm working on learning VB.Net to ensure I can code for Civil 3D, but I'll never abandon the use of Lisp as a programming language for AutoCAD. Got the emails, thanks. And thanks for this paragraph. It gives me much more assurance in going forward. Quote
Freerefill Posted November 25, 2009 Posted November 25, 2009 Lisp will (hopefully) never die because of it's ease to learn, versatility that's only (for the most part) hindered by the coder's own programming ability and ability to turn 5 minutes and 10 lines of code into hours of time saved. Sadly, Lisp can't do it all anymore, but it can still do a lot. I'm working on learning VB.Net to ensure I can code for Civil 3D, but I'll never abandon the use of Lisp as a programming language for AutoCAD. Well said. And to further the idea, understand that LISP is NOT unique to AutoCAD. It was originally developed for Artificial Intelligence! Everywhere you go, you meet people who will, hands down, admit to LISP being a thing of absolute beauty in terms of syntax, structure, and ease of use. It is limited by lack of development, which is sad, because I've investigated Common LISP (the core, universal LISP language) and, aside from a few add-ons, it's really quite similar to AutoLISP, and anyone could make the leap between the two without breaking a sweat. I would love to see Common LISP developed further. I would use it to code applications and games until my heart's content. It's almost worth learning C++ just so I can create a way to squeeze more use out of LISP. With apologies to Robert Frost, A God's Lament Some said the world should be in Perl; Some said in LISP. Now, having given both a whirl, I held with those who favored Perl. But I fear we passed to men A disappointing founding myth, And should we write it all again, I'd end it with A close-paren. http://xkcd.com/312/ Quote
rkmcswain Posted November 25, 2009 Posted November 25, 2009 Lisp will (hopefully) never die... Right. VBA died because Microsoft killed it off, but "autolisp" is Autodesk's own creation, and as long as AutoCAD is around, there is really no reason to kill it off. Quote
SteveK Posted November 26, 2009 Posted November 26, 2009 A God's Lament Some said the world should be in Perl; Some said in LISP. Now, having given both a whirl, I held with those who favored Perl. But I fear we passed to men A disappointing founding myth, And should we write it all again, I'd end it with A close-paren. http://xkcd.com/312/ I like it! Two things I like about lisp over some other languages: = not == is a boolean one operator is all that's needed, eg + 1 2 3 not 1 + 2 + 3 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.