3 Replies Latest reply on Mar 30, 2018 8:58 AM by Franz Dahinden

    3d pdf macro with configuration name

    Franz Dahinden

      I found this macro. It works fine for me,

      But I would like to add the configuration name from the part or assy at the end.

      I

       

      Thanks for the help in advance.

        • Re: 3d pdf macro with configuration name
          Franz Dahinden

          I can find this lines in an other macro, but it does not work:

           

          Dim vConfNameArr            As Variant

              Dim sConfigName             As String

              Dim sPath                   As String

              Dim i                       As Long

              Dim bRebuild                As Boolean

              Dim bRet                    As Boolean

              Dim sRev                    As String

           

          vConfNameArr = swModel.GetConfigurationNames

              For i = 0 To UBound(vConfNameArr)

                  sConfigName = vConfNameArr(i)
                 
                  If Not UCase(sConfigName) Like "*FLAT*" Then
                      swModel.ShowConfiguration2 sConfigName
                      bRebuild = swModel.ForceRebuild3(False)

           

          • Re: 3d pdf macro with configuration name
            Anthony Kanov

            Try changing this line:

            FileName = Left(FileName, Len(FileName) - 7) & "_Rev" & Part.CustomInfo2("", "Revision")

             

            to

             

            FileName = Left(FileName, Len(FileName) - 7) & "_Rev" & Part.CustomInfo2("", "Revision") & "_Cfg" & Part.ConfigurationManager.ActiveConfiguration.Name

             

            Sorry, the above will not work if you try to export a drawing. Rather modify the code like that:

             

            FileName = Left(FileName, Len(FileName) - 7) & "_Rev" & Part.CustomInfo2("", "Revision")

             

            If Right(Part.GetPathName, 3) = "drw" Then

               swExportPDFData.ExportAs3D = False

                FileName = FileName & ".pdf"

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

            Else

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

                FileName = FileName & "_Cfg" & Part.ConfigurationManager.ActiveConfiguration.Name & "_3D.pdf"

            End If