×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

how to run autocad using exe file?

how to run autocad using exe file?

how to run autocad using exe file?

(OP)
Hi!

I want to make group of macro commands, and all that
macro commands link with new (my) toolbar. Problem is:
How to make some exe file using VBA, which I can run from desktop, for lunching autocad.exe?

Thanks in advance!!!

RE: how to run autocad using exe file?

Use Visual Basic.

RE: how to run autocad using exe file?


You can't make an EXE with VBA, you need VB6 or VB.NET to do that.

Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting

UK steam enthusiasts: www.essexsteam.co.uk

RE: how to run autocad using exe file?

So far as I know, is use VB only.

RE: how to run autocad using exe file?

What you need to do is create a VB application that a reference to the AutoCAD API, i don't have installed AutoCAD in this computer but go reference on VB and look for the AutoCAD API Object.

RE: how to run autocad using exe file?

The code would look something like this:

CODE

    On Error Resume Next
    Set CadApp = GetObject(, "AutoCAD.Application")
    If Err.Number <> 0 Then     'Not Running
        Set CadApp = CreateObject("AutoCAD.Application")
        Err.Clear
        'AutoCAD may open a new drawing upon opening - close it
        CadApp.ActiveDocument.Close False
        If Err.Number <> 0 Then
            Err.Clear   'No Drawings are Open
        End If
    End If
    On Error GoTo 0

I used to use similar code to connect to AutoCAD 2000. As long as AutoCAD's object model hasn't changed significantly it should work for later versions.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources