Author Topic: Topics for a VBA Tutorial  (Read 19699 times)

0 Members and 1 Guest are viewing this topic.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Topics for a VBA Tutorial
« Reply #30 on: May 04, 2005, 03:05:36 PM »
MP, its funny that you sent me there, b/c I read that just this morning.  Whats also funny is I teach by that very principle.  What I meant about being a hacker is I have no formal trainging in VB(A) so the methods I will be showing are what I know. (Which is sometimes not the best way to get the job done)  Also, I dont program for a living, so by someothers standards, that makes me a hacker not a programmer.  Either way, I dont care, because if it helps me get my job done faster or more efficiently, its a program.
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)

daron

  • Guest
Topics for a VBA Tutorial
« Reply #31 on: May 04, 2005, 03:08:14 PM »
And if teaching it helps you get better knowledge, then you become a better hacker/programmer.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Topics for a VBA Tutorial
« Reply #32 on: May 04, 2005, 03:10:28 PM »
Quote from: Daron
And if teaching it helps you get better knowledge, then you become a better hacker/programmer.

Exactly!!!
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)

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Topics for a VBA Tutorial
« Reply #33 on: May 04, 2005, 08:57:14 PM »
Quote
Also, I dont program for a living, so by someothers standards, that makes me a hacker not a programmer.


here, here. According to some people there are only the the 2 clubs.

Personal Opinion : Programming is about solving problems. You solve problems, therefore ...

< deleted derogarory remarks about some academics >
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Topics for a VBA Tutorial
« Reply #34 on: May 05, 2005, 09:33:21 AM »
KWB - Thank You
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)

jonesy

  • SuperMod
  • Seagull
  • Posts: 15568
Topics for a VBA Tutorial
« Reply #35 on: May 06, 2005, 07:09:49 AM »
OK, getting back on track, would it be easy to create a proggy that can issue a save every 10 commands? Could this be covered in a course?
Thanks for explaining the word "many" to me, it means a lot.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Topics for a VBA Tutorial
« Reply #36 on: May 06, 2005, 10:07:29 AM »
Tracey, that would be a simple program in VBA ...
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

hyposmurf

  • Guest
Topics for a VBA Tutorial
« Reply #37 on: May 06, 2005, 11:53:48 AM »
Not only simple but dam handy. :)

ML

  • Guest
Topics for a VBA Tutorial
« Reply #38 on: May 06, 2005, 03:02:38 PM »
Has anyone tried applying VBA in other programs? I have several macros in Excel as well and quite frankly, enjoy it more then CAD at times.

The irony is that it helps me approach programming better in AutoCAD.

Anyone who is in this forum is very fortunate. I have learned a bit from different people and a lot from others.

I still have a long way to go but I have also come a long way in VBA. So anyone in this forum (with persistence) can learn just as I am.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Topics for a VBA Tutorial
« Reply #39 on: May 06, 2005, 03:11:56 PM »
OK, this is jumping ahead, but here is that program.  I will have to look to see who gets credit for this.

Code: [Select]

Private Sub AcadDocument_EndCommand(ByVal CommandName As String)

'***Below code is to AUTO save the drawing every 25 commands,
  If ThisDrawing.GetVariable("DWGTITLED") = 1 Then 'don't use on new, unsaved drawings
  Select Case CommandName
    Case UCase("undo"), UCase("u"), UCase("zoom"), UCase("z"), UCase("pan")
        command_count = command_count
    Case UCase("QSAVE"), UCase("SAVE")
        command_count = 0
    Case Else
        command_count = command_count + 1
        If command_count = 25 Then 'change this to any number you want
            ThisDrawing.Save
            command_count = 0
        End If
    End Select
  End If
End Sub
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)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Topics for a VBA Tutorial
« Reply #40 on: May 06, 2005, 03:13:57 PM »
Jeff_M gets credit for that module.
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)

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Topics for a VBA Tutorial
« Reply #41 on: May 06, 2005, 03:16:09 PM »
That's Jeff Mishler in case anyone wants to know. An excellent programming lad that wears a white hat.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

ML

  • Guest
Topics for a VBA Tutorial
« Reply #42 on: May 06, 2005, 03:17:43 PM »
Did everyone want too turn this into a code posting post? Or are we going to stick to basic theory?

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Topics for a VBA Tutorial
« Reply #43 on: May 06, 2005, 03:17:55 PM »
It needs to be placed in the ThisDrawing module of the Acad.dvb (or any dvb that will always be loaded)  For those of you who do not know where that is, I will be covering that in an upcoming handout.
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)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Topics for a VBA Tutorial
« Reply #44 on: May 06, 2005, 03:18:52 PM »
I am putting together handouts that will cover the theory, but by people posting code, we can use those examples in our discussions.
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)