Author Topic: whats the best way to set a variable  (Read 2551 times)

0 Members and 1 Guest are viewing this topic.

Bob Wahr

  • Guest
Re: whats the best way to set a variable
« Reply #15 on: October 26, 2007, 11:06:02 AM »
Eh, I was shooting from the hip.  No caffeine yet, hadn't even left the bedroom yet actually.  This is actually more what I had blodged together.  Your commandline solution is much better, far more generic, and much less likely to get broken.  What I did was the first way I came up with to solve a temporary problem I had.

Code: [Select]
Public booStartage As Boolean
Private Sub AcadDocument_BeginLisp(ByVal FirstLine As String)
  If FirstLine = "first line of your acad lisp" Then
    booStartage = True
  End If
End Sub

Private Sub AcadDocument_EndLisp()
  If booStartage Then
    'do your shiznizzle here
    booStartage = False
  End If
End Sub

ML

  • Guest
Re: whats the best way to set a variable
« Reply #16 on: October 29, 2007, 09:48:57 AM »
CM,
Isn't this a duplication of efforts?
If looks like you Set The AutoCAD Object to ThisDrawing on Startup, so why again if (command) COMMANDLINE is true? Just an observation

Mark

Code: [Select]
Sub App_StartMacro()
    Set AutoCAD = ThisDrawing.Application
End Sub

Private Sub AcadDocument_BeginCommand(ByVal CommandName As String)
    If CommandName = "COMMANDLINE" Then
        Set AutoCAD = ThisDrawing.Application
    End If
End Sub

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: whats the best way to set a variable
« Reply #17 on: October 29, 2007, 10:29:30 AM »
Thats a really good question, one that must wait for Bryco to show up, as he gave me that.  It works, so I didn't question it.
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

ML

  • Guest
Re: whats the best way to set a variable
« Reply #18 on: October 29, 2007, 11:05:45 AM »

No man, no disrespect to Bryco but I already gave you the answer my friend.

Look at the acad.dvb file that I sent to you "and" that you helped me with

I set it once with the acadstartup macro (in your case with the app_startmacro) and that was all that was needed.

It is working fine for me; I guess once you set the reference to Thisdrawing, it is retained from drawing to drawing until you close ACAD at which point there is no drawing :)

Mark

ML

  • Guest
Re: whats the best way to set a variable
« Reply #19 on: October 29, 2007, 11:06:52 AM »

Although, I am sure there is no harm (I think) in doing it the way you are.

Mark

ML

  • Guest
Re: whats the best way to set a variable
« Reply #20 on: October 31, 2007, 10:40:44 AM »
CM

After you start ACAD and hit F2
Do you see this:   ?

Loading AEC Detail Base...Initializing VBA System...
Loading VBA startup file...

Mark

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: whats the best way to set a variable
« Reply #21 on: October 31, 2007, 03:25:14 PM »
yes, but not b/c why you think.  I am loading VBA from my acad.rx file
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

ML

  • Guest
Re: whats the best way to set a variable
« Reply #22 on: October 31, 2007, 03:26:51 PM »
Which is exactly what I am doing  LOL
calling up the acvba.arx file

Great minds think a like I guess :)

Or in my case, cooked minds  :-(