Implementing SolidWorks eDrawings API as Microsoft ActiveX control
The SolidWorks eDrawings API is implemented as a Microsoft ActiveX control.
-
To create an entry point into the SolidWorks eDrawings API in VBA add an eDrawings 20XX Control to the Controls Toolbox and drag and drop the control to a user form or dialog.
NOTE: EModelView.dll is an ActiveX control that is registered as eDrawings 20XX Control when it is installed in \Program Files\SolidWorks Corp\SolidWorks eDrawings.
-
Access the EModelViewControl variable representing the control in the form and experiment with some of the SolidWorks SolidWorks eDrawings API calls. For example, try using IEModelViewControl::OpenDoc to open an SolidWorks eDrawings or SolidWorks document in the control or IEModelViewControl::ViewOrientation to change the current view of the document in the control.
Instantiating SolidWorks eDrawings control
You can instantiate the SolidWorks eDrawings control using a version-specific or version-independent CLSID.
To get your SolidWorks eDrawings control's CLSIDs:
-
Run Microsoft Visual Studio OLE/COM Object Viewer tool.
-
Open \Program Files\SolidWorks Corp\SolidWorks eDrawings\EModelView.dll.
It is recommended that you use the version-specific CLSID, and Microsoft Visual Studio will select it by default. However, because the CLSID is version-specific, with each new release of SolidWorks eDrawings you must edit:
Although you do not need to edit your application when working with multiple versions of SolidWorks eDrawings when using the version-independent CLSID, if your application uses a newer API than present in an older version of SolidWorks eDrawings installed by your user, your application will not work properly. This scenario can be difficult to debug remotely, especially with HTML applications.