This project is read-only.
    [Export(typeof(IExternalCallback))]
    [CommandGroupDefinition("Group1",
                SolidWorks.Interop.swconst.swDocumentTypes_e.swDocPART | 
                SolidWorks.Interop.swconst.swDocumentTypes_e.swDocASSEMBLY | 
                SolidWorks.Interop.swconst.swDocumentTypes_e.swDocDRAWING | 
                SolidWorks.Interop.swconst.swDocumentTypes_e.swDocNONE | 
                SolidWorks.Interop.swconst.swDocumentTypes_e.swDocSDM ,
            true,
            false,
            null)]
    [CommandGroupDefinition("Group2",
            SolidWorks.Interop.swconst.swDocumentTypes_e.swDocDRAWING,
            true,
            true,
            null)]
    public class CommandCallbacks: IExternalCallback
    {

        public CommandCallbacks()
        {

        }

        public dynamic ExternalCallbackContainer
        {
            get { return this; }
        }

        [CommandItemCallback("Group1","DynamicCommand1","CommandEnable1", null)]
        public void CommandCallback1()
        {
            // do some work when command is clicked
        }

        public int CommandEnable1()
        {
            /*
             * 0 - deselect and disable
             * 1 - deselect and enable, default
             * 2 - selects and disables
             * 3 - selects and enables
             * 4 - hides
            */

            return 1;
        }

        [CommandItemCallback("Group2", "DynamicCommand1", null, "Group2_DynamicCommand1")]
        public void CommandCallback2()
        {
            // do some work when command is clicked
        }
       
    }

Last edited Jun 30, 2010 at 6:12 PM by fixitchris, version 1

Comments

No comments yet.