automatically create dxf

Discussion in 'AutoCAD' started by morillo1976, Jan 19, 2008.

  1. morillo1976

    morillo1976 Guest

    Hi Everyone,

    I was wondering if anyone could suggest an automated method of
    creating an environment from two dxf files and then exporting the
    combined environment as another dxf file using autocad from an
    external program written in VB or using VBA.


    Many thanks,


    John.
     
    morillo1976, Jan 19, 2008
    #1
  2. morillo1976

    morillo1976 Guest

    Because the process has to be fully automated as I have two constantly
    changing input dxf files which have to be combined and fed into
    another program (not AutoCad) which cannot do the combining...
     
    morillo1976, Jan 20, 2008
    #2
  3. morillo1976

    morillo1976 Guest

    Hi Bob

    Many thanks for the suggestion. I am totally new to AutoCAD and the
    dxf file format. I had a look at the dxf files created by the other
    software and they seems really complex. I am hoping that AutoCAD will
    do the work for me by performing the following simple tasks using VB6:
    Open AutoCAD -> Import the two dxf files -> export the combined plot
    into another dxf file. Using VB I have managed to open an a new .dwt
    file. When I try using the following code to load a .dxf file nothing
    happens:

    Private Sub Command1_Click()
    Dim AcadDoc As AcadDocument
    Dim acadApp As AcadApplication

    Set acadApp = GetObject(, "AutoCAD.Application")
    Set AcadDoc = Application.Documents.Add("acad.dwt")
    acadApp.Visible = True

    Dim insPnt(0 To 2) As Double

    insPnt(0) = 2
    insPnt(1) = 2
    insPnt(2) = 2

    Set AcadDoc = acadApp.ActiveDocument.Import("c:\Drawing1.dxf",
    insPnt, 1)

    End Sub

    There are no error messages and AutoCAD opens fine, its just the
    content of the drawing is not displayed. Can't figure out what is
    going on.

    John.
     
    morillo1976, Jan 20, 2008
    #3
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.