Author Topic: plz point me in the right direction VB, LISP??  (Read 12078 times)

0 Members and 1 Guest are viewing this topic.

deegeecees

  • Guest
Re: plz point me in the right direction VB, LISP??
« Reply #15 on: September 09, 2005, 02:03:57 PM »
Change this:

(vl-vbaload "C:\Program Files\Autodesk\leecad\bobwahr.dvb")

to this:

(vl-vbaload "C:\\Program Files\\Autodesk\\leecad\\bobwahr.dvb")

*Notice the double backslash*

leebrown5

  • Guest
Re: plz point me in the right direction VB, LISP??
« Reply #16 on: September 09, 2005, 02:43:19 PM »
ooh- questions, lots of em-
1-why the dbl backslash? never seen that convention before- is it a VBA thing or what?
2- why does this routine see an esc as an enter?  it's non-interuptible when set to the msg box version
3-when it is set to the Debug.Print it doesn't.  print, that is.  or do anything observable except pause.  all those sums are inside somewhere, but I don't know how to retrieve them.
4-units- what does it take to override the default decimal summation ILO architectural?
5-what is the best book to buy?  keeping in mind (a)-I haven't seen anything about programming since BASIC in high school  and (b)-sometimes if I don't feel like I'm getting a clue, I have the attention span of a, well, a mosquito!

lee

Bob Wahr

  • Guest
Re: plz point me in the right direction VB, LISP??
« Reply #17 on: September 09, 2005, 03:26:45 PM »
ooh- questions, lots of em-
good.
Quote from: leebrown5
1-why the dbl backslash? never seen that convention before- is it a VBA thing or what?
Lisp uses backslash as an indicator for special functions so if you want a backslash to work as a backslash, you have to double it.  You can also use a single foreslash in lieu of backslashes for paths in lisp.
Quote from: leebrown5
2- why does this routine see an esc as an enter? it's non-interuptible when set to the msg box version
It's not actually seing esc as enter, when you hit esc, you cancel the message box and the command continues on.  If you want to be able to cancel the routine, you first have to tell the program what cancels the program.
Quote from: leebrown5
3-when it is set to the Debug.Print it doesn't. print, that is. or do anything observable except pause. all those sums are inside somewhere, but I don't know how to retrieve them.
It "prints" to the "Immediate" window in the IDE.  If the Immediate Window isn't showing, you can make it show in the view menu.  Something that you need to decide is what result you want.  The message box is not what you want I'm sure, nor the immediate window, but do you want it to write to a file or what?
Quote from: leebrown5
4-units- what does it take to override the default decimal summation ILO architectural?
That's a little more involved.  VBA doesn't do fractions so if you want the result in feet-inches-fraction, you need to do replace the decimals with fractions.  A function would be a good way to achieve this.
Quote from: leebrown5
5-what is the best book to buy? keeping in mind (a)-I haven't seen anything about programming since BASIC in high school and (b)-sometimes if I don't feel like I'm getting a clue, I have the attention span of a, well, a mosquito!
For VB(A) in General, I would recomend O'Reilly's VB(A) In A Nutshell.  For AutoCAD specific VBA, I would recomend Joe Sutphin's AutoCAD 200x VBA: Programmer's Reference

Bob Wahr

  • Guest
Re: plz point me in the right direction VB, LISP??
« Reply #18 on: September 09, 2005, 03:28:22 PM »
Instead of trying to tackle everything at once, Why don't you pick a single one of the things that you want to change and we'll work through them one at a time.

deegeecees

  • Guest
Re: plz point me in the right direction VB, LISP??
« Reply #19 on: September 09, 2005, 03:57:38 PM »
Quote
For VB(A) in General, I would recomend O'Reilly's VB(A) In A Nutshell. For AutoCAD specific VBA, I would recomend Joe Sutphin's AutoCAD 200x VBA: Programmer's Reference

I've always been partial to George O. Head...

http://www.fetchbook.info/search_George_O._Head/searchBy_Author.html

But its been a long time.

leebrown5

  • Guest
Re: plz point me in the right direction VB, LISP??
« Reply #20 on: September 12, 2005, 08:51:10 AM »
I've got George's AutoLISP in Plain English.  It really is!  Unfortunately I want to go beyond what he covers and I don't seem to have 'gotten it' because I can't use what he describes outside of the examples he gives.   dejavous-calculus and relay circuits.  I get very frustrated until finally the lightbulb goes on.  But I've taken my Ritalin now so I should be better :laugh:

first thing- where can I find an outline of what the nomenclature conventions are.  I've looked in the Acad-of-no-help files and they lead me in circles and down dead-end garden paths!  arghhhh  I want a list of phrases like Dim and Sub and KillSet along with the rules and conventions ForEach.  hee hee. nevermind.

Where can I find the VB4dummies that explains what the formatting rules are- where do hard returns matter, when do I need a space, what is case sensitive?

Bob Wahr

  • Guest
Re: plz point me in the right direction VB, LISP??
« Reply #21 on: September 12, 2005, 11:05:14 AM »
Definitely O'Reilly's In a Nutshell for that.  The in a nutshell books are great.  The first couple of chapters of the Sutphin book give you VBA basics as well though and would give you a more comprehensive reference for the ACAD object model.

deegeecees

  • Guest
Re: plz point me in the right direction VB, LISP??
« Reply #22 on: September 12, 2005, 11:18:18 AM »
Have you taken a look at the books that Bob Wahr suggested? They may have something more than George.

If you open your VBAIDE (command line: vbaide) and access the help files from VBA, you'll get all the functions for VBA (i.e. Sub, Dim, Foreach...). These functions are native to Visual Basic, and can only be found in the VBA help files. AutoCad pays no mind to describing them as it has already been done by MS. There are some AutoCad VBA functions can only be found in the AutoCad Developers Help files. Explore these areas thoroughly and you will soon find out that, short of having someone write a macro for you, these are your reference tools. This is how I learned VB, and I do not recommend learning this way as it has totally tweaked my brain.  :-P


Bob Wahr

  • Guest
Re: plz point me in the right direction VB, LISP??
« Reply #23 on: September 12, 2005, 04:06:26 PM »
Lee,

Have you thought about taking part in CmdrDuh's class?  It is not too far along at the moment.  I think that you could easily catch up and would learn a lot.

leebrown5

  • Guest
Re: plz point me in the right direction VB, LISP??
« Reply #24 on: September 12, 2005, 04:42:46 PM »
 Sorry I sometimes don't follow along well- this is only part of my daily challenge :roll:  I'll look up books at home on amazon.  As far as CmdrDuh- I  forgot about that- who what where?   If it's no bother to add my name on to an email distribution, I can go for that but I'm starting a welding course tommorrow- Tues/Thurs 4:30-7 till Thanksgiving plus I do have a family etc so I don't want to commit someone else's time for my sporadic involvement :wink:

Thanks Bob for the push along to the VB world.  The idea of linking into an xls format, etc is too cool!  I rechecked my AU classes, to make sure I didn't overlook a VB session in favor of lisp, when actually I think now a balance, maybe even in favor of VB.  Correct me if I'm wrong, but I feel like I need the lisp foundation, because it seems to be the primary link between non-native programs and the autocad platform itself.

Bob Wahr

  • Guest
Re: plz point me in the right direction VB, LISP??
« Reply #25 on: September 12, 2005, 05:14:49 PM »
I know enough lisp to run VBA programs and that's about it.  I can semi-follow programs written in lisp but there is no way in hell that I could actually write something in lisp.  It hurts my brain too badly to try.  For writing applications in autocad, flip a coin, they will both do the job admirably.  If you want to get into excel programming or even stand alone programs via VB or VB.NET, then VBA is probably a better route to go.

I linked both of those books on amazon when I first mentioned them although the Sutphin isn't released yet so if you don't want to wait you will have to get the 2004 release.

For the class, it is self paced and takes place on this forum so you should be able to fit it in around your life.  PM CmdrDuh and he can fix you up.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: plz point me in the right direction VB, LISP??
« Reply #26 on: September 15, 2005, 12:02:00 PM »
I got Lee signed up and he is starting to look at the first few docs.  He should be on his way soon.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Bob Wahr

  • Guest
Re: plz point me in the right direction VB, LISP??
« Reply #27 on: September 15, 2005, 12:23:47 PM »
Welcome to the dark side ;)

Andrea

  • Water Moccasin
  • Posts: 2372
Keep smile...

Peter Jamtgaard

  • Guest
Re: plz point me in the right direction VB, LISP??
« Reply #29 on: September 16, 2005, 10:06:32 AM »
I would append some information to the list presented earlier


LISP = LISt Processing or

Strengths
 It is native to the AutoCad command line.
 Doesn't require dimensioning of variables.
 Produces shorter routines, and therefore is faster to code.
 Has good user interface commands for working inside drawings, like selection sets, filters, getxxx functions...
 Lists are very powerful and are not in VB(a)!!!

Weaknesses:
 It is a document Level programming Language
 Dialog control language is more difficult to program than VBA forms.

Visual LISP = Visual LISt Processing
All of the strengths and weaknesses of LISP plus the addition of over 1000 new commands including access to the entire com object model of Autocad and the ability to import and manipulate other applications like word, excel,...


VBA = Visual Basic for Applications
Strengths
 It is an Application Level programming Language
 VBA forms are easier to develop.
 Intellisense in the VBAIDE helps new programmers to navigate the application model
 Operates external applications easier than lisp
Weaknesses
 Requires Dimensioning Variables
 Code is usually longer and requires more time to develop.
 Does allow use of Lists and Arrays are not as versitile and more difficult to manipulate.
 Is not native to the Autocad command line and require extra steps to call from Autocad.
 More difficult user entry.


My 2 cents is:
Use VLISP for all drawing level programs and drafting tools that do not require dialog controls.
Use VBA for dialog controls and for dealing with other applications.

Peter Jamtgaard P.E.