

- #Edrawings viewer 2014 command line arguments update#
- #Edrawings viewer 2014 command line arguments pro#
- #Edrawings viewer 2014 command line arguments code#
The “Get File” command complains to the user if it could not find a file. The easiest/fastest tool I have found is to add a “Get File” command. I don’t have a clean way to report the success of the sharing process. This will improve performance quite a bit if you are sharing many files at one time, However if you would like to give your user some feedback on if the file was shared successfully, you need to check this option and add a “ Get File” command, as I’ll describe next. If you figure the risk is rather low if this doesn’t work, leave “Halt execution of script until Shell command is completed” unchecked. There is no feedback to the user if the command was successful.
#Edrawings viewer 2014 command line arguments code#
This code blindly tries to create the shared file. $vault = New-Object -COMObject ConisioLib.EdmVault $vault.LoginAuto('%NameOfCurrentVault%',0) $folder=$vault.GetFolderFromPath('%SharedFolder%') $file=$vault.GetFileFromPath('%PathToSelectedFile%',$folder) $folder.AddFileShared($file.id,0) Choose to have the shell run a command line and paste this text in as the command: Then, add an action with “ Shell Execute” as the command. But be careful, don’t include the trailing backslash! Give this variable the value shared folder name. Next, create a custom variable named “SharedFolder”. Implementationįirst, in Dispatch, create a new administrative action. Then, tell the shell execute command you want to run the code with PowerShell by putting the word “PowerShell.exe” at the beginning of the line and put all of the code inside of double quotes. Take this code and combine all five lines into one, separated with semicolons. The AddFileShared function in line five is used to actually create the shared file. Line three defines the folder, the file in line four. At this point I have all I need to share the file.This is good because I don’t need the file’s folder anyway. However, since I don’t have a “” prefix in front of the variable, the variable remains unchanged.
#Edrawings viewer 2014 command line arguments update#
Since PowerShell passes GetFileFromPath’s second parameter by reference, you would expect the $folder variable value to update to a new value after that line is run. So, I am using the same $folder variable as defined in the previous line. PowerShell requires that you declare the second parameter as a folder object. You’ll notice GetFileFromPath it is using the $folder variable as its second parameter.


%NameofCurrentVault% is a Dispatch variable.Line 1 creates a PowerShell variable containing the PDM vault object.Here is the PowerShell code that we’ll have the shell command execute: I haven’t found a limit to the amount of text you can add to the shell command, so we have lots of options. However, it does let us to run our own custom code with the shell command. How it works – behind the scenesĭispatch doesn’t have a “share file” command.
#Edrawings viewer 2014 command line arguments pro#
Below is a procedure to have SOLIDWORKS PDM Pro Dispatch create shared files automatically for you. This is a handy way of sharing files without making copies. Shared files in PDM give you the ability to have the exact same file exist in multiple folders.
