1 Reply Latest reply on Jul 28, 2010 2:12 AM by Deepak Gupta

    How to save a drawing to pdf using a macro with the current File Name?

    RITESH BANKAPUR

      Hi,

       

      I want to use a macro for converting a Drawing file (.slddrw) to a PDF rather than using the process of File->SaveAs->.PDF

       

      Following is the coding for the macro which obviously outputs the file as PDF with the name RWT-ANCIL107. How can I change it so it takes the name of the current drawing file.

       

      Thanks for your help

       

       

      Dim swApp As Object

      Dim Part As Object
      Dim boolstatus As Boolean
      Dim longstatus As Long, longwarnings As Long

      Sub main()

      Set swApp = _
      Application.SldWorks

      Set Part = swApp.ActiveDoc
      boolstatus = Part.Extension.SelectByID2("Sheet1", "SHEET", 0.08896809136181, 0.2385039130435, 0, False, 0, Nothing, 0)
      Part.ClearSelection2 True
      longstatus = Part.SaveAs3("C:\Documents and Settings\rbankapur\Desktop\RWT-ANCIL107.PDF", 0, 0)
      End Sub