is it possible to control autocad lt in vba or vb etc

Discussion in 'AutoCAD' started by youngman, Sep 17, 2004.

  1. youngman

    youngman Guest

    hi,

    there are many autocadlt in use in our company,

    i wonder how to use the dvb file in these autocadlts.

    thank you.
     
    youngman, Sep 17, 2004
    #1
  2. youngman

    Joe Sutphin Guest

    A DVB is NOT usable in LT. The only alternative [if one wishes to take this
    routine], is to use the DDE mechanism in a VB application.

    Joe
     
    Joe Sutphin, Sep 17, 2004
    #2
  3. youngman

    Matt W Guest

    DDE (shudder)

    I took a walk down that road back in the days of R14 and VB5 when I was just
    starting to get my feet wet.
    It wasn't a very nice walk if I recall correctly.

    --
    I love deadlines
    I like the whooshing sound they make as they fly by.

    | A DVB is NOT usable in LT. The only alternative [if one wishes to take
    this
    | routine], is to use the DDE mechanism in a VB application.
    |
    | Joe
    | --
    |
    | | > hi,
    | >
    | > there are many autocadlt in use in our company,
    | >
    | > i wonder how to use the dvb file in these autocadlts.
    | >
    | > thank you.
    | >
    | >
    | >
    |
    |
     
    Matt W, Sep 17, 2004
    #3
  4. youngman

    Joe Sutphin Guest

    Very much agreed!!!
     
    Joe Sutphin, Sep 17, 2004
    #4
  5. youngman

    hwalker Guest

    try this to get you started

    Create a form and put a text box in it called txtbID then past the following code into it. After you've done that and compiled the program create a button in autocad and put the following in it
    ^c^c_ai_startapp program.exe
    ir creates a logfile in plotlogfile directory on c. It's just a small section from my multiplot program for LT2005


    Private Sub Form_Load()
    SetWindowPos Form1.hWnd, HWND_TOPMOST, 0, 0, 700, 475, Show_Window

    txtbID.LinkMode = 0 '0 = reset
    txtbID.LinkTopic = "AutoCAD LT.DDE|system" 'establish DDE link

    txtbID.LinkMode = 2
    txtbID.LinkTimeout = -1

    If Dir("C:\plotlogfile\*.log") > "" Then
    FileName$ = Dir("C:\plotlogfile\*.log")
    Do Until FileName$ = ""
    If UCase$(FileName$) <> "HARDCOPY.LOG" Then Kill "c:\plotlogfile\" + FileName$
    FileName$ = Dir
    Loop
    End If

    'Call Command1_Click
    AppActivate "AutoCAD LT", True
    If Dir("C:\plotlogfile", vbDirectory) = "" Then MkDir "c:\plotlogfile"
    'MkDir "c:\plotlogfile"
    txtbID.LinkExecute "LogfilePath c:\plotlogfile\" + vbCr
    txtbID.LinkExecute Chr$(27) + Chr$(27)
    txtbID.LinkExecute "LogFileOn" + vbCr
    txtbID.LinkExecute "Layout ?" + vbCr
    txtbID.LinkExecute "LogfileOff" + vbCr
    txtbID.LinkExecute Chr$(27) + Chr$(27)

    end sub
     
    hwalker, Sep 22, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.