Jump to content

Recommended Posts

Posted

Just wanting to see what everyone else was using for their LISP/VBA references for writing code in CAD.

 

The first book I used was:

AutoLISP Programming - Principles and Techniques

 

Around the house, I have:

AutoCAD 2006 VBA: A Programmer's Reference

Using Visual Basic with AutoCAD 2000

 

If you're using these, how do you feel about them and are there any other good references, either online or in text, that you swear by?

 

Ciao!

Posted

Cadtutor forum !!!! or any other well versed forum 1000's of code examples with the books you mentioned you should be able to work out the intent of the programs and modify to suit your needs.

 

Autocad R12 lisp manual it has real pages!

 

Last Autocad help you need to know what word you are looking for to get an answer even then it can be hard.

 

The majority of programmers here will probably tell you that they hack other programs to create new ones faster than starting from scratch.

 

Couple of suggestions write your code line by line if Lisp use multiple lisp statements rather than deep nested makes it easer to understand whats happening add lots of comments. Some of my code is now about 15 years old hard to remember what its doing. I have a bracket checker great for finding missing brackets or { in DCl's

Posted

BeauX

 

I literally started VBA with a dummies for VBA book, then I started becoming very familiar with The ACAD VBA help screens in The VBA Environment

 

Once you learn how to search for the object type that you are looking to modify, then you will find some very good, straight forward code examples to use and try.

 

I have Joe Sutphin's 2004 VBA book, I see you have it in 2006, that was a great book but more so as I began to better understand VBA.

 

Then beyond that, these forums have lots of code answers and helpful people.

 

And beyond that you will find that if you type what you need in Goggle, you are likely to get some good code examples as well.

 

You will eventually arrive at a point to where you will see code and learn how to tweak it to your needs.

 

Good Luck!

ML

Posted

The majority of programmers here will probably tell you that they hack other programs to create new ones faster than starting from scratch.

 

BIGAL

I am actually at the point to where I am hacking my own code these days :)

Start from scratch? What's that? :)

 

I don't care what any one says; no one created anything

We are all using what we have seen or got from somewhere, it is just a matter of manipulating the code to get a different result.

 

In .net, they have stored procedures which kind of work like functions, only they don't need to be in your project, yet you can still call them up and use them; that is pretty cool

 

I think of it like having a bunch of .bas files saved, as I do and being able to call them up through code as opposed to importing them.

 

I see the days of functions dwindling down possibly

 

ML

Posted

As you mention ML0940 I was involved in a large lisp architectural project it had a round 50 individual lisp's.

 

It is a good idea to break out common used code and put these into defuns stored in one program an example was setting layers and linetypes these were stored in a master txt file and any program could then use the list to create & set these correctly as required all was user definable. There was no hard coding of these linetypes or layers only a variable name was consistent across all programs. Most of the programs were dealing with 4 layers at a time.

Posted

Hey BIGAL

 

Yes, I try to never reinvent the wheel; that is why organization is key with code.

 

In my case, I have a series of .bas files (exported from VBA) of commonly used code, like open dialog boxes, then if I need them again in another project, I can just import them in.

Also, while I do have quite a few VBA projects, I started creating one project called Tools about 6 months ago, that contains most of my every day modules that I can see myself using daily. That makes getting to code quicker as well.

 

I am also REALLY big on annotation as well; it saves me a whole lot of brain power not having to figure out what I was doing months ago, I just read my comments. It also saves me having to explain code too much, after I post or share.

 

Conservation of energy :)

 

ML

  • 2 months later...
Posted

Hi Guys,

 

Do you have ebook copy of that book Autocad VBA programming that I can download?

 

 

cheers,

jaypro

  • 16 years later...
Posted

I want to learn autolisp visual lisp vba and dcl all of it what should I refer 

Posted

So n my view automation should either make your work more accurate or quicker (and accurate), which is what most of us do. Every now and then we also make up LISPs to see if we can or for fun... but essentially they are all guided by the work we do..

 

So with that in mind I think the best way to learn is with a real application, something that will improve your work, but start simple. What do you do every day that you could automate? Work through that problem and make something that works. 

 

As for resources Lee Mac has great pages on making and running LISPs on his website (Tutorials), AfraLisp (Link above) goes through how to do things clearly, this forum is great for posting problems and asking for help "how do I do this", there are other forums like the Swamp that can help also.

 

So to learn I would ask on a forum for help creating a LISP to do a real task and also ask the answers if they can annotate - add notes - to the answers so you can see what each line does. People are far happier to give answers if you ask for explanations and take time to learn.

 

 

When I started making LISPS I started simple 'ZA' (Zoom All), about 5 lines but still use it today, saves about 1/2 second each time I use it.

 

 

Posted

Agree with Steven start small, no good asking for I want a BOQ for my 30Mb dwg. Some code can end up like 1000 lines. 

 

There is a tutorial included with a Acad called "down the garden path". I think its down in samples directory. There are electronic books out there, look on kindle, another is Afralisp has good tutorials.

 

So ask about a task we can provide the steps involved without providing code so you can have a go. 

 

Be aware CHATGP & Copilot will write lisp code some times its ok but often it is not usable.

 

Lastly get a copy of Notepad++ a great editor for lisp code.

 

 

  • Like 1

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...