Your Products have been synced, click here to refresh
Sub Main 'Declares the File System Object And Instantiates it Dim objFSO Set objFSO = CreateObject("Scripting.FileSystemObject") 'Declares PC-DMIS As the Active Program/Application Dim PCDApp, PCDPartProgram, PCDCommands, PCDCommand, retval Set PCDApp = CreateObject("PCDLRN.Application") Set Part = PCDApp.ActivePartProgram Set PCDCommands = PCDPartProgram.Commands 'Declares Variables from the prg As Objects Dim VPART As Object Dim VDESCRIPTION As Object Dim VSERIALNUMBER As Object Dim VDATE As Object Dim VTIME As Object Dim RESULTS As String 'Pulls the variables from the prg Set VPART = Part.GetVariableValue ("VPART") Set VDESCRIPTION = Part.GetVariableValue ("VDESCRIPTION") Set VSERIALNUMBER = Part.GetVariableValue ("VSERIALNUMBER") Set VDATE = Part.GetVariableValue ("VDATE") Set VTIME = Part.GetVariableValue ("VTIME") 'Declares the Filepath, Folder, And the Filename As a String strPath = Part.Path 'Uses the prg path As the path For the folder 'sets the folder Name And the Path For the Folder strFolderName = VPART.StringValue & "_" & VDESCRIPTION.StringValue & "_" & VSERIALNUMBER.StringValue & "_" & VDATE.StringValue strFolder = strPath & "\RESULTS\" & strFolderName If Not objFSO.FolderExists(strFolder) Then 'This command creates the folder Set objFolder = objFSO.CreateFolder(strFolder) End If 'CLEANUP And SCRIPT Close Set PART = Nothing Set PCDApp = Nothing End Sub
Sub Main 'Declares the File System Object And Instantiates it Dim objFSO Set objFSO = CreateObject("Scripting.FileSystemObject") 'Declares PC-DMIS As the Active Program/Application Dim PCDApp, PCDPartProgram, PCDCommands, PCDCommand, retval Set PCDApp = CreateObject("PCDLRN.Application") Set Part = PCDApp.ActivePartProgram Set PCDCommands = PCDPartProgram.Commands 'Declares Variables from the prg As Objects Dim VPART As Object Dim VDESCRIPTION As Object Dim VSERIALNUMBER As Object Dim VDATE As Object Dim VTIME As Object Dim RESULTS As String 'Pulls the variables from the prg Set VPART = Part.GetVariableValue ("VPART") Set VDESCRIPTION = Part.GetVariableValue ("VDESCRIPTION") Set VSERIALNUMBER = Part.GetVariableValue ("VSERIALNUMBER") Set VDATE = Part.GetVariableValue ("VDATE") Set VTIME = Part.GetVariableValue ("VTIME") 'Declares the Filepath, Folder, And the Filename As a String strPath = Part.Path 'Uses the prg path As the path For the folder 'sets the folder Name And the Path For the Folder strFolderName = VPART.StringValue & "_" & VDESCRIPTION.StringValue & "_" & VSERIALNUMBER.StringValue & "_" & VDATE.StringValue strFolder = strPath & "\RESULTS\" & strFolderName If Not objFSO.FolderExists(strFolder) Then 'This command creates the folder Set objFolder = objFSO.CreateFolder(strFolder) End If 'CLEANUP And SCRIPT Close Set PART = Nothing Set PCDApp = Nothing End Sub
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |