2 Replies Latest reply on Jan 9, 2015 2:07 AM by None None

    Property tap builder API help

    None None

      Hello,

       

      I have made in solidworks (2015 SP1) via the Property Tap builder. A textbox called "Description:"

      I want to automatically add the description from Solidworks to my .PFD file name. example: (Filename)_ (version) _3D_ (description)

       

      Can somebody help?

       

      Thanks in advance

       

      Option Explicit

      Option Compare Text

       

      Dim swApp As SldWorks.SldWorks

      Dim Part As ModelDoc2

      Dim lErrors As Long

      Dim lWarnings As Long

       

      Sub CreatePDF()

      Dim FileName As String

      Dim Ext As String

       

      Set swApp = Application.SldWorks

      Set Part = swApp.ActiveDoc

       

      Dim swExportPDFData As SldWorks.ExportPdfData

      Set swExportPDFData = swApp.GetExportFileData(1)

      swExportPDFData.ExportAs3D = True

       

      FileName = Part.GetPathName

       

      FileName = Left(FileName, Len(FileName) - 7) & "V1" '& description from solidworks here

       

      Me.LabelStatus.Caption = "Creating 3D File"

      FileName = FileName & " 3D.pdf"

       

      Me.LabelStatus.BackColor = vbRed

      Me.Repaint

       

      Part.Extension.SaveAs FileName, swSaveAsCurrentVersion, swSaveAsOptions_Silent, swExportPDFData, lErrors, lWarnings

       

      Me.LabelStatus.Caption = "Finished " & Me.LabelStatus.Caption

      Me.LabelStatus.BackColor = vbGreen

       

      End Sub

       

      Custom Properties: http://i.imgur.com/l0fVhqJ.png