4 Replies Latest reply on Nov 17, 2017 2:22 AM by Deepak Gupta

    Save as pdf macro and some

    Steve Miller

      Hello, I have no programming skills and have found a couple macros that will save a drawing as a .PDF. These are great but i would like to save the PDF name as the part configuration name followed by the drawing sheet size then the rev. letter.

      Thank you for taking the time.

        • Re: Save as pdf macro and some
          Francisco Martínez

          try this out, #TASK

          it is a free program called #task, (it has free and pay features)

           

          there is a save pdf that is free, you can also run your macros from this program.

          in the arguments section of the save pdf module , you can select the naming convention

          • Re: Save as pdf macro and some
            Alex Burnett

            You will be hard pressed to get people to volunteer to write you a macro for free. It's most productive if you could post the code you're starting with as well as whatever changes you have made. It's not difficult to do what you are asking but it is difficult to understand the details such as how you store your revision variable.

             

            The users in this forum are very willing to help teach others if they show they are willing to do a little hard work understanding and implementing ideas by troubleshooting their macro and asking questions when they get stuck.

             

            With all that said, the drawing size can be found with the following block of code.

             

            Set swDraw = objActiveDoc
                    Set swSheet = swDraw.GetCurrentSheet
                    strDrawSize = swSheet.GetProperties(0)
                    
                    Select Case strDrawSize
                        Case 0, 1
                            strDrawSize = "A"
                        Case 2
                            strDrawSize = "B"
                        Case 3
                            strDrawSize = "C"
                        Case 4
                            strDrawSize = "D"
                        Case 5
                            strDrawSize = "E"
                        Case 6, 7
                            strDrawSize = "A4"
                        Case 8
                            strDrawSize = "A3"
                        Case 9
                            strDrawSize = "A2"
                        Case 10
                            strDrawSize = "A1"
                        Case 11
                            strDrawSize = "A0"
                        Case 12
                            strDrawSize = "X"
                        Case Else
                            strDrawSize = "X"
                    End Select
            

             

            The configuration name can be found with something like:

            model.IGetActiveConfiguration().Name where model is an IModelDoc2 object. If you are starting with a drawing then finding the reference model to get that information from can be a bit interesting.

             

            Start with this and let us know where you get with it.

            • Re: Save as pdf macro and some
              Deepak Gupta

              Steve, can you try the macros from these posts:

               

              Print to PDF (Filename and Rev Number from custom proporties)

              Save As File name based on custom property

              Macro Export PDF Custom File Name & Settings

               

              But like you said you've no programming skills, I would suggest you to try #TASK as suggested Francisco Martínez