Error: Failed to connect to SOLIDWORKS

Solution Number: 1122
Title: Error: Failed to connect to SOLIDWORKS
Platform: Windows
Applies to: LiveLink™ for SOLIDWORKS®
Versions: All versions
Categories: Error Messages, Geometry, Import, Import
Keywords:

Problem Description

When I try to synchronize the geometry between COMSOL and SOLIDWORKS, the error message

Failed to connect to SOLIDWORKS. Please make sure SOLIDWORKS is running.

is displayed, and the COMSOL Multiphysics tab in SOLIDWORKS is not available.

Solution

If you have licensed LiveLink for SOLIDWORKS, the COMSOL Installer creates an add-in in SOLIDWORKS called LiveLink for COMSOL. This add-in should appear in the SOLIDWORKS user interface, listed in the Add-Ins dialog box, accessible from the Tools menu.

The connection between COMSOL and SOLIDWORKS can fail if the add-in cannot be loaded by SOLIDWORKS. This could happen for example if the COMSOL installation is moved to a different folder. In the case of such a failure, you can reinstall LiveLink for SOLIDWORKS, or repair the installation as described in knowledgebase 1221.

Manual Repair

It is possible to set up the connection manually as follows:

  1. Close SOLIDWORKS if it is running on your computer.
  2. Click the Start menu symbol in the lower-left corner of your Windows desktop.
  3. Enter cmd in the Start Search field.
  4. cmd.exe appears in the list of programs. Right-click on it and select Run as administrator.
  5. In the command window that appears enter one of the following, depending on your operating system:

Note: Both commands need to be entered, and the complete command string must be written on a single row.

COMSOL 5.0 and newer:

On Windows 64-bit:

C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe "C:\Program Files\COMSOL\COMSOLXX\Multiphysics\ext\LiveLink\SolidWorks\win64\cslivelinksw.dll" /codebase

C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe "C:\Program Files\COMSOL\COMSOLXX\Multiphysics\ext\LiveLink\SolidWorks\win64\cscomactivex.dll" /codebase

In the above C:\Program Files\COMSOL\COMSOLXX\Multiphysics is the local path to your COMSOL installation. Use the version number corresponding to your installation, for example C:\Program Files\COMSOL\COMSOL54 for COMSOL Multiphysics 5.4.

On Windows 32-bit:

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe "C:\Program Files\COMSOL\COMSOLXX\Multiphysics\ext\LiveLink\SolidWorks\win32\cslivelinksw.dll" /codebase

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe "C:\Program Files\COMSOL\COMSOLXX\Multiphysics\ext\LiveLink\SolidWorks\win32\cscomactivex.dll" /codebase

Note that the last COMSOL version to support 32-bit versions of Windows is COMSOL Multiphysics 5.1.

COMSOL 4.4:

On Windows 32-bit:

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe "C:\Program Files\COMSOL\comsol44\ext\LiveLink\SolidWorks\win32\cslivelinksw.dll" /codebase

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe "C:\Program Files\COMSOL\comsol44\ext\LiveLink\SolidWorks\win32\cscomactivex.dll" /codebase

On Windows 64-bit:

C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe "C:\Program Files\COMSOL\comsol44\ext\LiveLink\SolidWorks\win64\cslivelinksw.dll" /codebase

C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe "C:\Program Files\COMSOL\comsol44\ext\LiveLink\SolidWorks\win64\cscomactivex.dll" /codebase

COMSOL 4.3b and earlier:

On Windows 32-bit:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe "C:\Program Files\COMSOL\comsol43b\ext\LiveLink\SolidWorks\win32\cslivelinksw.dll" /codebase

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe "C:\Program Files\COMSOL\comsol43b\ext\LiveLink\SolidWorks\win32\cscomactivex.dll" /codebase

On Windows 64-bit:

C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\RegAsm.exe "C:\Program Files\COMSOL\comsol43b\ext\LiveLink\SolidWorks\win64\cslivelinksw.dll" /codebase

C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\RegAsm.exe "C:\Program Files\COMSOL\comsol43b\ext\LiveLink\SolidWorks\win64\cscomactivex.dll" /codebase

In the above C:\Program Files\COMSOL\comsol43b is the local path to your COMSOL installation.

On Windows 8 the .NET 3.5 framework that is used by COMSOL 4.3b and earlier versions is not automatically enabled. If you cannot find RegAsm.exe in the folder above, please follow these steps:

  1. Go to Control Panel > Programs > Turn Windows features on or off.
  2. Mark the .NET Framework 3.5 check box. This will install the required .NET framework. The required directories C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ and C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\ should now be available.
  3. Enter the commands as shown above to register the add-in.

COMSOL 4.2

If following the instructions on page 28 of the Installation And Operations Guide to set up the connection results in this error message:

The module "C:\COMSOL42\ext\plug-ins\Solid...\cslivelinksw.dll" failed to load.

try the above procedure.

Activate the Add-in

To complete the registration you may also have to activate the add-in in SOLIDWORKS:

  1. Open SOLIDWORKS and on the Tools menu select Add-Ins.
  2. In the Add-Ins dialog box that opens, make sure that the LiveLink for COMSOL item is active by selecting the appropriate check boxes.

Disclaimer

COMSOL makes every reasonable effort to verify the information you view on this page. Resources and documents are provided for your information only, and COMSOL makes no explicit or implied claims to their validity. COMSOL does not assume any legal liability for the accuracy of the data disclosed. Any trademarks referenced in this document are the property of their respective owners. Consult your product manuals for complete trademark details.