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.
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...
The basic thing you need then is a full understanding of the dxf format for whatever program created the dxf file, and have your program modify, if necessary and insert the appropriate data in the correct section of the dxf file.
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.
PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.