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 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") '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 objFSO.FolderExists(strFolder) Then GoTo labelEnd 'This command creates the folder objFolder = objFSO.CreateFolder(strFolder) labelEnd 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 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") '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 objFSO.FolderExists(strFolder) Then GoTo labelEnd 'This command creates the folder objFolder = objFSO.CreateFolder(strFolder) labelEnd End Sub
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |