Autocad Hardcore Lisp

Posted on  by  admin

Thanks Tom, my job is to think listen to and teach corporate or in-housedevelopers and professional developers about the API's for the ISD products.I'll be the first person to admit that VBA is not perfect, but I also knowwhat the future may bring. Armed with this fore knowledge of the future, andof what is currently being worked on, I stick to my statement that VBAprovides a better programming foundation for the future than LISP does. Forcivil engineers who want to take advantage of the objects in LDT and Civil3D, VBA is the only way to go.Cheers,Peter FunkAPI Product ManagerISDAutodesk, Inc.ps, the error trap I put in was fine. If the user bails from a prompt, bailfrom the program. As far as filtered selection sets, I almost never use themin VBA. I'd rather loop over the database or the selected objects lookingfor the things that I want. You may have a little better performance with afiltered selection set, but for me I'd rather not bother.

Lisps

If I'm thatconcerned about performance, then I'd write it in C. Hi Tom,While we pick on individual Lisp commands which can or can't be readilyreplicated with VBA, it really does not help a person making a generaldecision on which program to use. It is just as easy to make a list ofcommands in VBA which can't be readily replicated with Lisp.

Well put, TomD.Peter, I respect your position and admire you for getting to the level that you're at. However, I think you should slow down a little when it comes to your opinion about what's best for the masses. It's seems to be a balancing act between 'freedom of choice' and total 'communism'!Many of us have been programming in Lisp/Vlisp for a long time and have become rather proficient in it. Some of us have actually built entire careers on it. But you're telling us we should just abondon it?I know several really 'TOP-NOTCH' programmers here in Arizona that know how to program in both VLisp & VBA. Of those coders, the 2 that I have the most respect for (and by-the-way, they don't even know each other) have both told me the same thing:'.Lisp/VLisp is a powerful language, that, if used properly, can do some amazing things.' Another highly-respect programmer, David Stein, feels the same way.

He even states that ALL languages have shortcomings of some kind and that the application at hand should dictate the language that should be applied to solve the particular problem.Your statement that we should all abandon Lisp for VBA is like telling the programming world of planet Earth that we should give up all the available languages and that we should all program in C# because that's where the future is.How receptive do you think people would be to that? It might make sense to you in your own personal experience, but one person can only know and see so much.When Autodesk introduced STB plot styles in the brand-new Windows version, I totally started doing everything in paper space with a white background. Then when lineweights were introduced, I starting using WYSIWYG for all my drawings, working in paper space and displaying plot styles. It was Nirvana for me and I could see the logic in it and where Autodesk was going. White was even the default screen background color for a while.However, as most people realize, I think I am one of about maybe 10 people that like working with lineweights on a white screen background. No matter how legible the vectors are, NOBODY likes drawing with anything other than a black background.That experience taught me a lesson.

No matter how 'cutting-edge' I thought a particular concept was, the majority will always rule. Even if it doesn't make sense to me personally.When VBA becomes the majority rule, and in the current day it's NOT, then eventually, I and many others will then 'jump ship' from VLisp. But it will have to be because the language is so obviously more efficient and productive than VLisp that it would be foolish not to use it. It won't be just because it's the logical preference of some individual that really likes it.Slow down, dude!! Let us do want we want, like and feel productive with until it just doesn't work anymore.As you should probably know already, Autodesk's programming policy 'seems' to be this:Maintain outdated systems until it becomes obvious that relatively nobody is using it anymore.

Then 'retire' it. Take it out of the menu, but leave the commands in the application indefinitely, just in case.I have adopted this philosophy in my development, because, after experience, it makes a lot of sense. Please as many of the people as you can, even at the expense of your own preference.

As much as you despise that archaic system, maintain it anyway, for the sake of those that don't share your opinion, but PAID good money for the application, nonetheless.Now THAT, to me, is true, unselfish wisdom. Thank you Nick for your input.I started this thread to do three things: console people starting outprogramming to use VBA and not LISP, inform professional engineers (notprogrammers) that the best way to interact with LDT and Civil objects iswith ActiveX, and to give 'the masses' some direction about where the APIsat Autodesk are going in the future.1.

If you have never programmed, then VBA is a better choice of languages tolearn for three reasons: The syntax is closer to other high levelprogramming languages, it is better documented, and the knowledge that yougain from it will have a longer future.I think that you would all agree that LISP has a unique syntax, just asHP calculators with Reverse Polish Notation have a unique syntax. When I wasin school, I used to love my HP because not only was I fast with it, but noone would borrow it during a test. LISP is similar in that it has lots ofgreat short cuts, which once you learn them make it very fast to program in.However, those same shortcuts pigeon hole your programming style. That andthe horrid DCL language make it a very poor choice for a novice programmer.As far as the documentation, not only is VBA better documented withinthe Autodesk products, but there are more resources externally for you touse. If you look at the help file that ship with our products, they are alldocumented using the VBA syntax and with VBA examples for a novice to lookat and copy.The longer future is has two components, the first is that you can usethe knowledge that you gain from VBA inside of LDT to other programs likeExcel and Access. We'll talk about the other point later.2. For professionals that are looking to interact with the LDT and Civil 3Dmodels, then there is only one choice - COM or ActiveX.

COM / ActiveX arecurrently the ONLY programming interface to these objects and is the heartof VBA. If you want to interact with these object models, then this is youronly choice. This COM / ActiveX interface is the same for all developers.ADN members are using this interface to extend and enhance LDT and Civil 3Din some very exciting ways. While you can use ActiveX from inside of VLisp,the interface and syntax is very difficult. If you look at the objects inthe Civil 3D preview, you will find that they don't even have DXF codesexposed, so all interaction will be via COM.3. As far as the future, you should look at two things: the Details portionof LDT 2005, and the.NET interface that shipped with the products built onAutoCAD 2005.What is important to understand about Details, is that weprovided a mechanism so that you could extend Details it include more userdefined materials by using a combination of COM,.NET or ObjectARX for theprogramming and XML to extend the user interface. With these, you can make anew set of materials that will seamlessly tie into the existing UI with verylittle code.

We tried to provide this API via LISP, but were unable to makeit work.In AutoCAD 2005, we have the first preview of a.NET API forAutoCAD. With.NET we can combine the power of ObjectARX with the simplicityof VBA to provide you with incredible programming power. I know that soundslike a bunch of marketing hype, but I've heard senior software engineerslaughing at how easy it is to program with.NET. It provides them with ahuge new user interface toolkit, and frees them of some of the drudgery thatis involved with C programming. As we move forward, we plan to expose moreof our internal tools to you via.NET. There are NO plans to expose any ofthe.NET interfaces to LISP. I'm not even sure if it's possible.I've said it before I've written and maintained more LISP code than most ofthe people on this newsgroup so I know its power.

If you want to write tightcompact code that deals with lines, arcs and circles, and you already knowLISP, by all means keep on writing. LISP isn't going anywhere.However, if you want to deal with the newer objects in AutoCAD (tables), LDTand Civil 3D, then you need to learn VBA, not as an end, but as a beginningof something new.I'll be teaching a class at AU on programming inside of Civil 3D that I hopeto see many of you at. I'll be buying beer at the ISD party for anyone whowants to 'chat' about the merits of VBA with me.Cheers,Peter FunkAPI Product ManagerAutodesk, Inc. I would call Robert stuntman's civil essentials a major player in the LDDgame. And almost all of it is written in lisp. Sorry Peter, but unlessautodesk is planning on shelving lisp, I find your argument on the weakside.TimB'Peter Funk - Autodesk, Inc.' Wrote in messagenews:412f9625$13@newsprd01.

Tom, I've written and maintained more LISP code than the majority of the people out there so I know how powerful LISP can be. For simple AutoCAD entities and simple command line driven applications, AutoLISP is a fine tool.There are some nice tools like MAPCAR LAMBDA in LISP for making some verycompact code (you can do a lot with very little code, and tends to be very criptic and hard to debug in the future). If you are need a quick and dirty toolfor some one off task, the lisp is fine.

For more complex applications with dialog boxes, interaction with external database or working with the more complex object models in Land and Civil, then LISP is not the best tool for you to work with. I've seen lots ofcode in these newsgroups that are using direct DXF calls on LDT objects,hacking directly into the dictionary objects etc. While these may get you the information that you want, they are not recommended ways to work withthese objects. In addition, using the VLAX VLA interface is another way to getat the information in the LDT databae, but the amount of overhead to usethese functions isn't worth it.

As we move forward, we have moved beyond what can be done with LISP and if you want to keep up with these new developments, you need to change your toolkit, from something that deals with list of data to something that can deal with objects. The tools that are provided for you in VBA and VB.NETare staggering, for example a database grid control that you can add to adialog box with just a few lines of code, that provides read/write access into an external database. To me that is easy and quick code! I'm not telling you that you have to move to VBA from LISP, I'm suggesting that you may want to. Of the hardcore LISP programmers that I know thatdeal with the more complex object models of LDT and ADT, they have all switched over to VBA, and I can't think of one that would ever want to go back. If you've never programmed, then VBA is the place to start, and not LISP. VBA will provide a better foundation for future programming that LISPwill.

Cheers, Peter Funk API Product Manager Autodesk, Inc. That would be Robert Seltman's. Not stuntman's. I used the spell check andguess what I did:-).' Tim Badger' wrote in messagenews:41331ede$11@newsprd01. I would call Robert stuntman's civil essentials a major player in the LDD game.

And almost all of it is written in lisp. Sorry Peter, but unless autodesk is planning on shelving lisp, I find your argument on the weak side. TimB 'Peter Funk - Autodesk, Inc.' Wrote in message news:412f9625$13@newsprd01. TomI've written and maintained more LISP code than the majority of thepeople out there so I know how powerful LISP can be. For simple AutoCADentities and simple command line driven applications, AutoLISP is a fine tool. There are some nice tools like MAPCAR LAMBDA in LISP for making some very compact code (you can do a lot with very little code, and tends to be verycriptic and hard to debug in the future).

If you are need a quick and dirty tool for some one off task, the lisp is fine. For more complex applications with dialog boxes, interaction withexternal database or working with the more complex object models in Land andCivilthen LISP is not the best tool for you to work with. I've seen lots of code in these newsgroups that are using direct DXF calls on LDT objects, hacking directly into the dictionary objects etc. While these may get you the information that you want, they are not recommended ways to work with these objects. In addition, using the VLAX VLA interface is another way to get at the information in the LDT databae, but the amount of overhead to use these functions isn't worth it. As we move forward, we have moved beyond what can be done with LISP andif you want to keep up with these new developments, you need to change your toolkit, from something that deals with list of data to something thatcan deal with objects.

The tools that are provided for you in VBA and VB.NET are staggering, for example a database grid control that you can add to a dialog box with just a few lines of code, that provides read/write access intoan external database. To me that is easy and quick code! I'm not telling you that you have to move to VBA from LISP, I'msuggesting that you may want to. Of the hardcore LISP programmers that I know that deal with the more complex object models of LDT and ADT, they have allswitched over to VBA, and I can't think of one that would ever want to go back. If you've never programmed, then VBA is the place to start, and notLISP.

VBA will provide a better foundation for future programming that LISP will. CheersPeter Funk API Product Manager Autodesk, Inc. 'Laurie Comerford' wrote in messagenews:413264142@newsprd01. While we pick on individual Lisp commands which can or can't be readily replicated with VBA, it really does not help a person making a general decision on which program to use. It is just as easy to make a list of commands in VBA which can't be readily replicated with Lisp.

This typeof argument gains little for anybody. When making a decision on what language to use, we should be looking atthe forest - not the trees, and certainly not the bark on the trees.Very true, which is why the original blanket statement, which seemed to sayVBA is.better. I felt was misleading and incorrect. For an beginner with no background in either language, I have not the slightest doubt that VBA is easier to learn and due to it's better IDE, easier to code than lisp.Consider a simple function to draw a line, similar to the built in LINEcommand.

Not as a practical example, but containing the aspects that mostentry-level customizers would likely want to accomplish. Explain the errortrapping required for handling the point information. IMO, it's much easierto do, and explain, with lisp. Personally, I found that after about 2 months my VBA programming capabilities matched my Lisp capabilities developed over15 years. At the user interface level, I could program better in VBA after 10minutes that I ever achieved with DCL files. If you want your programs to be easy to use, then the user interface is critical.I'd agree 100% with you, there. I haven't done a DCL since I found outwhat's possible with VBA in that respect.

Autocad Lisp Forum

The most compelling technical argument I have seen for lisp is its List handling ability, but if I had never heard of a List, it would not even vaguely inhibit my ability to program what I want. It's sort of like I'm using a shovel, so a handle is an essential component, but if I'm using a backhoe lack of a handle doesn't create any problems.My point is not to argue for one or the other, only that they are both verypowerful and should be learned. (setq x (enget (car entsel))) a lotSeen many times at my own command line.;)PS: It's nice hearing from you, I thought you were still mad at me. 'Peter Funk - Autodesk, Inc.' Wrote in messagenews:4132a529$12@newsprd01. I've said it before I've written and maintained more LISP code than mostof the people on this newsgroup so I know its power. If you want to writetight compact code that deals with lines, arcs and circles, and you already know LISP, by all means keep on writing.

LISP isn't going anywhere.Ok, ok, you've finally settled me down! When I hear things like youroriginal post, I get a little worried. I'll be teaching a class at AU on programming inside of Civil 3D that Ihope to see many of you at. I'll be buying beer at the ISD party for anyone who wants to 'chat' about the merits of VBA with me.Wish I could take you up on that. Tim,I haven't seen Robert's code so I'm not familiar with what it does.However, if you are writing code that deals with lines, arc and circles witha command line interface, then LISP will continue to be a programminglanguage that you can use. If you work with the advanced engineering objectsin LDT and or Civil 3D, if you have dialogs or if you want to interact withexternal files like Excel and Access, then VBA is the language to startwith.Cheers,Peter FunkAPI Product ManagerAutodesk, Inc. I can see more clearly now what point you were trying to make.

I just think the 'shock' value of your initial post diverted my focus away from the underlying meaning.Everything you said in this last post makes total sense to me and I can appreciate the information you've given us. Thanks you for clarifying things for me.I am currently learning C so that I can gain some basic understanding of that language, then jump to C# &.NET. (I'm not even going to bother with VBA). I do realize that those are the development environments I'm going to have to be in if I want to remain competitive in this field, it's just that in the meantime, VLisp still works VERY well and gives me reliable, fast access to the only LDD objects I need: the surfaces and the alignments. There's a plethora of creative things one can do with reliable access to just those two objects, and the code I've established in VLisp is doing that nicely.My hope is that by the time VLisp will no longer serve my programming needs, I will have picked up C# by then and am running with it.Thanks again for your insight. Robert's code also ignores most of the LDT OBJECTS in its current state. Heuses lisp to work with Softdesk point blocks, etc.

To be perfectly honest(and Robert knows this,) this is one of the major reasons I've never boughthis software.Assuming little or no prior investment in either language:LISP cannot handle OBJECTS as easily as VBA.C3D will consist entirely of OBJECTS for it's advanced features.Therefore, VBA is the language of choice for future development in Civilapplications.Peter and I are presenting a C3D API class at AU this year. I hope to seemany of you there, so that he can show you the power of the new objects andVBA as I sit back and watch.-James Wedding, P.E.IT ManagerJones & Boyd, Inc.Dallas, TXXP/1 on P4-3.4/1GLDT2004&5+C3Dup now for AU2004!

Hi,All you need do is open the samples file provided with the software andstart reading them.

Coments are closed