TheSwamp

Code Red => VB(A) => Topic started by: Matersammichman on August 08, 2006, 03:21:23 PM

Title: DXF vs DWG
Post by: Matersammichman on August 08, 2006, 03:21:23 PM
Okay, I know how to open dwgs from VB6, but how do I open DXF's?
Title: Re: DXF vs DWG
Post by: Jeff_M 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.
.....
Title: Re: DXF vs DWG
Post by: Matersammichman 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?
Title: Re: DXF vs DWG
Post by: Jeff_M 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
Title: Re: DXF vs DWG
Post by: Matersammichman 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.
Title: Re: DXF vs DWG
Post by: hendie 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