This project is read-only.

External User Controls

The Generic Addin Framework allows you to create user controls in a separate library. This allows for a more modular design ( After the external control library is compiled, the DLL and TLB files must be placed in the same folder as SwAddinBase and SwAddinHelpers DLLs. When SolidWorks loads the Generic Addin Framework, it imports any types tagged with [Export(typeof(IExternalUserControl))] attribute. The IExternalUserControl interface acts as a proxy, passing the external control type as a dynamic type to the Generic Addin Framework.
Task Pane Control Template
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using SwAddinHelpers.Base;
using SwAddinHelpers.Contracts;
using SwAddinHelpers.Attributes;
using System.Runtime.InteropServices;
using System.ComponentModel;
using System.ComponentModel.Composition;
using System.ComponentModel.Design;
using System.ComponentModel.Composition.Hosting;
using System.Reflection;

namespace ExternalTaskPaneControl
    public class Class1: TaskPaneControlBase, IExternalUserControl
        public const string PROGID = "SwExternalControls.ExternalTaskPaneControl1";

        public Class1()

        public dynamic ExternalUserControl
            get { return this; }

        public void SomeMethodToFire(object sender, EventArgs e)


Last edited Jun 18, 2010 at 12:45 AM by fixitchris, version 4


No comments yet.