6 Replies Latest reply on Oct 7, 2015 7:42 AM by Solidworks Selim

    Exporting a Sheet Metal part as a DXF File

    Darren Smith

      Can anybody help?????

       

      (I know that this subject has been asked about several times before)

       

      I have the following macro that flatterns a sheet metal component, then exports it as a DXF file.

       

      However,

       

      it is the SaveAs2 that is not working. I DO NOT KNOW WHY!!!

       

      Sub main()
          Set swApp = Application.SldWorks
         
          Dim Doc As PartDoc

       

          Set oDoc = swApp.ActiveDoc

       

          swApp.ActiveDoc.ActiveView.FrameState = 1
            
          boolstatus = oDoc.Extension.SelectByID2("Flat-Pattern2", "BODYFEATURE", 0, 0, 0, False, 0, Nothing, 0)
            
          oDoc.ClearSelection2 True
            
          oDoc.SetBendState 2
            
          oDoc.EditRebuild

       

          TempFileName = "C:\Temp.dxf"

       

          oDoc.SaveAs2 TempFileName, 0, True, True

       

          oDoc.SetBendState 3

       

          oDoc.EditRebuild
      End Sub

       

      Has anybody any idea what I am doing wrong?

       

      Many thanks in advance!!!

       

      Darren