Import DXF as Shape to Master

Started by ged325, November 19, 2010, 09:00:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ged325

trying to import a DXF file as a shape so I can use it in a master (which ends up added to a stencil)

I can use m.import() if it's a jpeg but if I try with a DXF I get "please specify the type of file you are working with"

Any help greatly appreciated. 



            app = New ApplicationClass()
            '  app.Visible = False

            Dim docs As IVDocuments = app.Documents

            stencil = docs.AddEx("", VisMeasurementSystem.visMSDefault, CType(VisOpenSaveArgs.visAddStencil, Integer), 0)


            Dim m As IVMaster

dim dirName as string = "C:\Imports"
Dim dir1 as new DirectoryInfo(dirName)



            For Each f As FileInfo In dir1.GetFiles()
                m = stencil.Masters.Add()

                If f.Extension.ToLower() = ".dxf" Or f.Extension.ToLower() = ".dwf" Then
                    Dim s As Visio.Shape
                    s = stencil.Drop(m, 4.25, 5.5)
                    s.Import("" + dirName + "\" + f.Name + "")
                    s.Text = f.Name
                end if


           Next
     
           stencil.SaveAs(dir2.ToString() + "\" + "The_stencil.vss")
           stencil.Close()           
           app.Quit()