In 2018, SOLIDWORKS allowed users to copy a PDM file’s hyperlink to the clipboard. However, even though the Copy Link function is still available on a file’s context-sensitive menu, no mention of it can be found in the 2020 help file.
The ability to create SOLIDWORKS PDM Pro hyperlinks to files and folders has been around for many years. Hyperlinks are a great tool for opening, finding, and viewing documents from external sources. The problem has always been that the hyperlinks are not very easy to create. Before 2018, your only choices were to use the programming interface or build the link through SQL.
The idea with Copy Link is that you right-click on a file, click Copy Link, and that adds the hyperlink to your clipboard. Later, when you paste the link into an HTML-aware editor (e.g., MS Office), you’re pasting the name of the file into your document with the hyperlink properly added. The problem is that you cannot paste the link into non-HTML-aware locations. Notepad, your ERP system, database fields -practically everywhere else, the paste function doesn’t work.
I believe most of the time it would be better to have the hyperlink added to the clipboard as plain text. If it’s in plain text you can do anything you want with it. For a long time, I was doing this with a PDM add-in. It worked great, but writing add-ins isn’t for everyone. So, this blog post shows how I figured out a way to make a PDM data card button copy my hyperlinks to my clipboard for me.
[Warning: In this section, I get into some code writing. You don’t really need to know any of this to make it work in your data cards. If you just want to make it work, skip to the next section.]
The trick is to make the data card button run some PowerShell code to copy PDM hyperlinks to your clipboard.
No, I don’t normally use such terrible variable names. But card buttons will only accept 255 characters, so I purposefully made this code as tight as possible.)
To take this code and put it into a card button, combine all seven lines into one and separate them with semicolons. Then, tell the command button 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.
Now, let’s put this into action. First, add a button to your PDM Pro data card. Give the button a clever caption, set the command type to “Command String”, and cut/paste the code below into the data card’s “Command” property. Then, you can copy your PDM hyperlinks to your clipboard as often as your heart desires.
powershell.exe "$v=New-Object -COMObject ConisioLib.EdmVault;$v.LoginAuto('%2',0);$fo=$v.RootFolder;$f=$v.GetFileFromPath('%1',[ref]$fo);$fi=$f.id;$foi=$fo.id;Set-Clipboard -Value \"conisio://%2/explore?projectid=$foi&documentid=$fi&objecttype=1\""
The button properties should look like this:
One last point: You need to check-in the file at least once for the hyperlink to be built properly.
Sorry PDM Standard users, this method uses API so it will not work for you.
SOLIDWORKS PDM 2025 - What's New
Configuration Properties in SOLIDWORKS PDM Data Cards
How to Create Dynamic Lists in SOLIDWORKS PDM Standard Data Cards
SOLIDWORKS PDM - Implement Working Revisions
How to Hide a Variable in a SOLIDWORKS PDM Data Card, But Keep it Searchable
About Jeff Sweeney
Jeff Sweeney is a SOLIDWORKS Data Management Product Manager at GoEngineer.
Get our wide array of technical resources delivered right to your inbox.
Unsubscribe at any time.