2 Replies Latest reply on Feb 26, 2018 3:19 PM by Jordan Lowe

    Automatically find new part template path

    Jordan Lowe

      Hi guys,


      I'm new to Solidworks APIs and I'm trying to find out how I can use a macro to open a new part, i.e. open the Part.prtdot file. Now I'm aware I can use:


      Set Part = swApp.NewDocument("C:\ProgramData\SolidWorks\SOLIDWORKS 2017\templates\Part.prtdot", 0, swSheetWidth, swSheetHeight)


      however, I want to have the macro search for the Part.prtdot file so the program can work on any computer, regardless of the file location.


      Any guidance or tips you can provide is appreciated, thanks.