I am looking for a way to save converted files to a specific folder based on which user is running the task.
Ex. Task name - Convert to PDF
User 'Harry' runs the 'Convert to PDF' task. The drawing is converted and saved to 'M:\\PDFS\\Harry'.
So the Output File Details would look something like
M:\\PDFS\\
I started to play around with 'Advanced Scripting Options' but I cant seem to figure out how to create a custom variable. I use the code below is a couple of my SolidWorks macro (VBA), which gets the username of the logged in user.
Any suggestions would be appreciated.
Thank you.
<p>Function UserName() As String</p><p> Dim myShell</p><p> Dim content</p><p> Dim value</p><p> </p><p> Set myShell = CreateObject("WScript.Shell")</p><p> </p><p> For Each value In myShell.Environment("PROCESS")</p><p> content = Split(value, "=")</p><p> If content(0) = "USERNAME" Then UserName = content(1)</p><p> Next</p><p> </p><p> 'If UserName = "" Then UserName = "-"</p><p> </p><p> Set myShell = Nothing</p><p>End Function</p>SolidworksSolidworks Pdm enterprise Pdm