Author Topic: DXF vs DWG  (Read 3169 times)

0 Members and 1 Guest are viewing this topic.

Matersammichman

  • Guest
DXF vs DWG
« on: August 08, 2006, 03:21:23 PM »
Okay, I know how to open dwgs from VB6, but how do I open DXF's?

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Re: DXF vs DWG
« Reply #1 on: August 08, 2006, 03:36:55 PM »
Quote from: Acad Help for Open method
.....It is recommended that you save the current drawing before calling this method.

This method opens AutoCAD drawing files (DWG) only. Use the Import method to open SAT, EPS, DXF, WMF, or BMP format files.
.....

Matersammichman

  • Guest
Re: DXF vs DWG
« Reply #2 on: August 08, 2006, 04:13:57 PM »
Jeff, yes, I've tried the Import code such as is suggested in VBA, but without success.
Ideas?

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Re: DXF vs DWG
« Reply #3 on: August 08, 2006, 04:54:38 PM »
Hmmm, I just tested and the Open method works with DXF files.....
Code: [Select]
Sub Open_Test()
Dim dwg As AcadDocument

Set dwg = Application.Documents.Open("C:\Jeffs Test Files\junk\dxftest.dxf")

End Sub

Matersammichman

  • Guest
Re: DXF vs DWG
« Reply #4 on: August 08, 2006, 05:41:26 PM »
Thanks for the help Jeff.
I've got that working thanks to you.
Now, what I want to do is batch convert my dxf's into dwg's (big surprise, huh? Probably not). So, how do I populate a list or combo box with a folder full of dxf's? I know there are plenty of these out there that I could buy, but in my case, poor and broke is the mother of necessity.

hendie

  • Guest
Re: DXF vs DWG
« Reply #5 on: August 09, 2006, 03:11:29 AM »
This is for Word but it's easy to modify to suit
http://www.vba-programmer.com/Snippets/Code_Word/Building_Filename_Array.html

then you just use
Code: [Select]
mylistbox.list()=myarrayto populate your listbox