Example #1
0
        public void GetAddInInfo(ref EdmAddInInfo poInfo, IEdmVault5 poVault, IEdmCmdMgr5 poCmdMgr)
        {
            Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("MTcwMjQwQDMxMzcyZTMzMmUzMGhycFlDaldXNDVZeWxhdnFwckswQnRhMHVwclp2OWNrUEltNHczb21ENDQ9;MTcwMjQxQDMxMzcyZTMzMmUzMG4xOFQ1dnBDR1oxalUvazM5UmlTRkdUelJRcHkweURnVERXRXRabnpaZVE9");

            Vault  = (IEdmVault20)poVault;
            CmdMgr = poCmdMgr;
            Info   = poInfo;

            //Specify information to display in the add-in's Properties dialog box
            poInfo.mbsAddInName   = "PDM DWG Converter";
            poInfo.mbsCompany     = "FlowerRobot";
            poInfo.mbsDescription = "This will convert dwgs to dxf and pdf";
            poInfo.mlAddInVersion = 19;

            //Specify the minimum required version of SolidWorks PDM Professional
            poInfo.mlRequiredVersionMajor = 10;
            poInfo.mlRequiredVersionMinor = 1;

            //Register this add-in as a task add-in
            poCmdMgr.AddHook(EdmCmdType.EdmCmd_TaskRun);
            //Register this add-in to be called when selected as a task in the Administration tool
            poCmdMgr.AddHook(EdmCmdType.EdmCmd_TaskSetup);
            //Register this add-in to be called when the task is launched on the client computer
            poCmdMgr.AddHook(EdmCmdType.EdmCmd_TaskLaunch);
            //Register this add-in to provide extra details in the Details dialog box in the task list in the Administration tool
            poCmdMgr.AddHook(EdmCmdType.EdmCmd_TaskDetails);
            //Register this add-in to be called when the launch dialog box is closed
            poCmdMgr.AddHook(EdmCmdType.EdmCmd_TaskLaunchButton);
            //Register this add-in to be called when the set-up wizard is closed
            poCmdMgr.AddHook(EdmCmdType.EdmCmd_TaskSetupButton);
        }
Example #2
0
    public void GetAddInInfo(ref EdmAddInInfo poInfo, IEdmVault5 poVault, IEdmCmdMgr5 poCmdMgr)
    {
        poInfo.mbsAddInName   = "C# Add-in";
        poInfo.mbsCompany     = "Artrans S.A";
        poInfo.mbsDescription = "Menu add-in that shows a message box.";
        poInfo.mlAddInVersion = 1;

        poInfo.mlRequiredVersionMajor = 6;
        poInfo.mlRequiredVersionMinor = 4;

        Vault = poVault;

        //Añado el hook para las validaciones en los cambios de estado.
        poCmdMgr.AddHook(EdmCmdType.EdmCmd_PreState);


        poCmdMgr.AddCmd(1, "C# Add-in", (int)EdmMenuFlags.EdmMenu_Nothing);
        //Register hooks

        /*
         * //Notify the add-in when a file has been added
         * poCmdMgr.AddHook(EdmCmdType.EdmCmd_PostAdd);
         *
         * //Notify the add-in when a file has been checked out
         * poCmdMgr.AddHook(EdmCmdType.EdmCmd_PostLock);
         *
         * //Notify the add-in when a file is about to be checked in
         * poCmdMgr.AddHook(EdmCmdType.EdmCmd_PreUnlock);
         *
         * //Notify the add-in when a file has been checked in
         * poCmdMgr.AddHook(EdmCmdType.EdmCmd_PostUnlock);
         */
    }
Example #3
0
        public void GetAddInInfo(ref EdmAddInInfo poInfo, IEdmVault5 poVault, IEdmCmdMgr5 poCmdMgr)
        {
            poInfo.mbsAddInName           = "Demo AddIn";
            poInfo.mlRequiredVersionMajor = 17; //SOLIDWORKS PDM 2017 SP0

            poCmdMgr.AddCmd(TEST_CMD_ID, "Test Menu Command");
        }
Example #4
0
        public void GetAddInInfo(ref EdmAddInInfo poInfo, IEdmVault5 poVault, IEdmCmdMgr5 poCmdMgr)
        {
            try
            {
                poInfo.mbsAddInName           = nameof(PdmAddIn); //"PdmAddIn";
                poInfo.mbsDescription         = "Bare bones PDM add-in";
                poInfo.mbsCompany             = "ACME Corp";
                poInfo.mlAddInVersion         = 1;
                poInfo.mlRequiredVersionMajor = 15;
                poInfo.mlRequiredVersionMinor = 0;

                poCmdMgr.AddCmd(1, "AA Atach Files", (int)(
                                    EdmMenuFlags.EdmMenu_OnlyInContextMenu |
                                    EdmMenuFlags.EdmMenu_OnlyFiles |
                                    EdmMenuFlags.EdmMenu_OnlySingleSelection)); // Only supporting single selection for now.

                // Example of adding a hook
                poCmdMgr.AddHook(EdmCmdType.EdmCmd_PostAdd);
            }
            catch (Exception ex)
            {
#if Debug
                MessageBox.Show(ex.ToString());
#else
                MessageBox.Show(ex.Message);
#endif
            }
        }
Example #5
0
        public void GetAddInInfo(ref EdmAddInInfo poInfo, IEdmVault5 poVault, IEdmCmdMgr5 poCmdMgr)
        {
            poInfo.mbsAddInName           = "ButtonPdmAddIn";
            poInfo.mlAddInVersion         = 1;
            poInfo.mlRequiredVersionMajor = 16;

            poCmdMgr.AddHook(EdmCmdType.EdmCmd_CardButton);
        }
Example #6
0
        public void GetAddInInfo(ref EdmAddInInfo poInfo, IEdmVault5 poVault, IEdmCmdMgr5 poCmdMgr)
        {
            poInfo.mbsAddInName           = "SW PDM Helper";
            poInfo.mbsDescription         = "Utility functions for SOLIDWORKS PDM";
            poInfo.mlAddInVersion         = 1;
            poInfo.mlRequiredVersionMajor = 17; //SOLIDWORKS PDM 2017 SP0

            poCmdMgr.AddCmd((int)Commands_e.GetIds, "Get ID");
        }
Example #7
0
        public void GetAddInInfo(ref EdmAddInInfo poInfo, IEdmVault5 poVault, IEdmCmdMgr5 poCmdMgr)
        {
            // Version
            const int ver = 14;

            try
            {
                if (ThisIsTask)
                {
                    #region Task

                    poInfo.mbsAddInName   = $"Make .eprt files Task Add-In ver." + ver;
                    poInfo.mbsCompany     = "Vents";
                    poInfo.mbsDescription = "Создание и сохранение файлов .eprt для листовых деталей";
                    poInfo.mlAddInVersion = ver;
                    currentVer            = poInfo.mlAddInVersion;

                    //Minimum SolidWorks Enterprise PDM version
                    //needed for C# Task Add-Ins is 10.0
                    poInfo.mlRequiredVersionMajor = 10;
                    poInfo.mlRequiredVersionMinor = 0;

                    //Register this add-in as a task add-in
                    poCmdMgr.AddHook(EdmCmdType.EdmCmd_TaskRun);
                    //Register this add-in to be called when
                    //selected as a task in the Administration tool
                    poCmdMgr.AddHook(EdmCmdType.EdmCmd_TaskSetup);
                    poCmdMgr.AddHook(EdmCmdType.EdmCmd_TaskSetupButton);
                    poCmdMgr.AddHook(EdmCmdType.EdmCmd_TaskDetails);

                    #endregion
                }
                else
                {
                    #region Addin

                    // Addin version
                    poInfo.mbsAddInName           = "C# Task Add-In";
                    poInfo.mbsCompany             = "Vents";
                    poInfo.mbsDescription         = "PDF & EPRT";
                    poInfo.mlAddInVersion         = 1;
                    poInfo.mlRequiredVersionMajor = 6;
                    poInfo.mlRequiredVersionMinor = 4;
                    poCmdMgr.AddCmd(1, "Convert", (int)EdmMenuFlags.EdmMenu_Nothing, "", "", 0, 0);

                    #endregion
                }
            }
            catch (COMException ex)
            {
                Logger.Add("GetAddInInfo HRESULT = 0x" + ex.ErrorCode.ToString("X") + "; " + ex.Message);
            }
            catch (Exception ex)
            {
                Logger.Add(ex.Message + "; \n" + ex.StackTrace);
            }
        }
Example #8
0
 public void GetAddInInfo(ref EdmAddInInfo poInfo, IEdmVault5 poVault, IEdmCmdMgr5 poCmdMgr)
 {
     poInfo.mbsAddInName = "编码器v1";
     poInfo.mbsCompany   = "JES Company";
     //poInfo.mbsDescription = "产品和零部件编码生成器;服务器:" + Utility.SQLHelper.strConn.Substring(7, Utility.SQLHelper.strConn.IndexOf(";", 0) - 7);
     poInfo.mbsDescription         = "产品和零部件编码生成器";
     poInfo.mlAddInVersion         = 2;
     poInfo.mlRequiredVersionMajor = 5;
     poInfo.mlRequiredVersionMinor = 2;
     poCmdMgr.AddHook(EdmCmdType.EdmCmd_CardButton);
 }
Example #9
0
        private void SetAddInInfo(ref EdmAddInInfo poInfo)
        {
            var a = Assembly.GetExecutingAssembly();

            poInfo.mbsAddInName           = a.GetAttributeValue <AssemblyTitleAttribute>();
            poInfo.mbsCompany             = a.GetAttributeValue <AssemblyCompanyAttribute>();
            poInfo.mbsDescription         = a.GetAttributeValue <AssemblyDescriptionAttribute>();
            poInfo.mlAddInVersion         = a.GetMajorVersion();
            poInfo.mlRequiredVersionMajor = 14;
            poInfo.mlRequiredVersionMinor = 4;
        }
Example #10
0
 void IEdmAddIn5.GetAddInInfo(ref EdmAddInInfo poInfo, IEdmVault5 poVault, IEdmCmdMgr5 poCmdMgr)
 {
     try
     {
         SetAddInInfo(ref poInfo);
         poCmdMgr.AddHook(EdmCmdType.EdmCmd_TaskSetup);
         poCmdMgr.AddHook(EdmCmdType.EdmCmd_TaskRun);
     }
     catch (Exception ex)
     {
         HandleEx(ex, true);
     }
 }
Example #11
0
        public void GetAddInInfo(ref EdmAddInInfo poInfo, IEdmVault5 poVault, IEdmCmdMgr5 poCmdMgr)
        {
            poInfo.mbsAddInName   = "AddinPdf";
            poInfo.mbsCompany     = "SOLIDWORKS Corporation";
            poInfo.mbsDescription = "Adds menu command items";
            poInfo.mlAddInVersion = 1;

            poInfo.mlRequiredVersionMajor = 10;
            poInfo.mlRequiredVersionMinor = 0;

            //poCmdMgr.AddCmd(100, "Выгрузить Pdf-file", (int)EdmMenuFlags.EdmMenu_OnlyMultipleSelection);
            poCmdMgr.AddCmd(100, "Выгрузить Pdf-file", (int)EdmMenuFlags.EdmMenu_OnlySingleSelection);
        }
Example #12
0
        public void GetAddInInfo(ref EdmAddInInfo poInfo, IEdmVault5 poVault, IEdmCmdMgr5 poCmdMgr)
        {
            poInfo.mbsAddInName           = "Custom Addin";
            poInfo.mbsCompany             = "Hawk Ridge Systems";
            poInfo.mbsDescription         = "My custom addin";
            poInfo.mlAddInVersion         = 1;
            poInfo.mlRequiredVersionMajor = 18;
            poInfo.mlRequiredVersionMinor = 0;

            // create commands
            // create context menu commands
            poCmdMgr.AddCmd(100, "CustomAddin\\Action1");
            poCmdMgr.AddCmd(200, "CustomAddin\\Assy Only BOM");
        }
Example #13
0
        public void GetAddInInfo(ref EdmAddInInfo poInfo, IEdmVault5 poVault, IEdmCmdMgr5 poCmdMgr)
        {
            poInfo.mbsAddInName   = "DownloadDxf";
            poInfo.mbsCompany     = "SOLIDWORKS Corporation";
            poInfo.mbsDescription = "Adds menu command items";
            poInfo.mlAddInVersion = 1;

            poInfo.mlRequiredVersionMajor = 10;
            poInfo.mlRequiredVersionMinor = 0;

            poCmdMgr.AddCmd(100, "Добавить Dxf-file", (int)EdmMenuFlags.EdmMenu_OnlyMultipleSelection);
            poCmdMgr.AddCmd(100, "Добавить Dxf-file", (int)EdmMenuFlags.EdmMenu_OnlySingleSelection);
            poCmdMgr.AddHook(EdmCmdType.EdmCmd_TaskRun);
            poCmdMgr.AddHook(EdmCmdType.EdmCmd_TaskSetup);
        }
Example #14
0
        public void GetAddInInfo(ref EdmAddInInfo poInfo, IEdmVault5 poVault, IEdmCmdMgr5 poCmdMgr)
        {
            //Specify information to display in the add-in's Properties dialog box
            poInfo.mbsAddInName   = "ExportExcelAddin";
            poInfo.mbsCompany     = "WISE Corp.";
            poInfo.mbsDescription = "Export a slddrawing BOM.";
            poInfo.mlAddInVersion = 3;

            //Specify the minimum required version of SolidWorks PDM Professional
            poInfo.mlRequiredVersionMajor = 6;
            poInfo.mlRequiredVersionMinor = 4;

            // Register a menu command
            poCmdMgr.AddCmd(1007, "明细表导出-科德", (int)(EdmMenuFlags.EdmMenu_OnlySingleSelection | EdmMenuFlags.EdmMenu_ContextMenuItem | EdmMenuFlags.EdmMenu_OnlyFiles), "导出明细表到制定文件");
            //poCmdMgr.AddCmd(1007, "明细表导出-科德", (int)EdmMenuFlags.EdmMenu_Nothing);
            poCmdMgr.AddCmd(1, "明细表导出-科德", (int)EdmMenuFlags.EdmMenu_Nothing, "导出明细表到制定文件");
        }
Example #15
0
        void EdmLib.IEdmAddIn5.GetAddInInfo(ref EdmAddInInfo poInfo, IEdmVault5 poVault, IEdmCmdMgr5 poCmdMgr)
        {
            //Fill in the AddIn's description
            poInfo.mbsAddInName = "Monitor";
            poInfo.mbsCompany = "SolidWorks";
            poInfo.mbsDescription = "Addin";
            poInfo.mlAddInVersion = 1;

            //Minimum Conisio version needed for .Net Add-Ins is 6.4
            poInfo.mlRequiredVersionMajor = 6;
            poInfo.mlRequiredVersionMinor = 4;

            poCmdMgr.AddCmd(1, "Test Menu from SWEPDMAddin2", (int)EdmMenuFlags.EdmMenu_Nothing, "", "", 0, 0);

            //uncomment this line to add all hooks
            AddAllHooks(poCmdMgr);
        }
Example #16
0
        void EdmLib.IEdmAddIn5.GetAddInInfo(ref EdmAddInInfo poInfo, IEdmVault5 poVault, IEdmCmdMgr5 poCmdMgr)
        {
            //Fill in the AddIn's description
            poInfo.mbsAddInName = "Automatic File Removal";
            poInfo.mbsCompany = "Norco Industries";
            poInfo.mbsDescription = "Automatically removes files of the same name as targeted file with specified extension.  Written to remove released documents when revision is in process.";
            poInfo.mlAddInVersion = 1;

            //Minimum Conisio version needed for .Net Add-Ins is 6.4
            poInfo.mlRequiredVersionMajor = 6;
            poInfo.mlRequiredVersionMinor = 4;

            poCmdMgr.AddCmd(1, "Debug Menu\\Automatic File Removal Tool",(int)EdmMenuFlags.EdmMenu_Nothing, "", "", 0, 0);

            //uncomment this line to add all hooks
            AddAllHooks(poCmdMgr);
        }
        private String uniqueId = "F4C84E2B-3D7B-4FD2-B65A-3323C82D65BD"; // generated a guid to use, can be any unique string

        public void GetAddInInfo(ref EdmAddInInfo poInfo, IEdmVault5 poVault, IEdmCmdMgr5 poCmdMgr)
        {
            try {
                poInfo.mbsAddInName           = "PDM Custom Tab API Example";
                poInfo.mbsCompany             = "GSC";
                poInfo.mbsDescription         = "This AddIn will show the basics of what is needed to create your own custom tab in PDM Professional.";
                poInfo.mlAddInVersion         = 20170926;
                poInfo.mlRequiredVersionMajor = 17;
                poInfo.mlRequiredVersionMinor = 5;  // Need to use 17.5 until 18 SP0 is released

                // need to add both a hook and a command to create the tab.  Since I am not using the command, I am only showing it in admin tool
                poCmdMgr.AddHook(EdmCmdType.EdmCmd_PreExploreInit);
                poCmdMgr.AddCmd(12321415, "CTC", (int)EdmMenuFlags.EdmMenu_NeverInContextMenu + (int)EdmMenuFlags.EdmMenu_Administration);
                // hook to intercept when the tab is activated
                poCmdMgr.AddHook(EdmCmdType.EdmCmd_ActivateAPITab);
            } catch (System.Runtime.InteropServices.COMException ex) {
                MessageBox.Show($"HRESULT = 0x{ex.ErrorCode.ToString("X")} {ex.Message}", "Interop Error", MessageBoxButton.OK, MessageBoxImage.Error);
            } catch (Exception ex) {
                MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Example #18
0
        public void GetAddInInfo(ref EdmAddInInfo poInfo, IEdmVault5 poVault, IEdmCmdMgr5 poCmdMgr)
        {
            try
            {
                //Information to display in the add-in's Properties dialog box
                poInfo.mbsAddInName   = "getLink";
                poInfo.mbsCompany     = "korbman";
                poInfo.mbsDescription = "Allows the user to get different types of links to the selected file. Autor: [email protected]";
                poInfo.mlAddInVersion = 1010100;
                //Minimum required version of SOLIDWORKS PDM Professional
                poInfo.mlRequiredVersionMajor = 17;
                poInfo.mlRequiredVersionMinor = 5;

                poCmdMgr.AddCmd(1000, "get Link...", (int)EdmMenuFlags.EdmMenu_MustHaveSelection + (int)EdmMenuFlags.EdmMenu_OnlyFiles); //Вызов из контекстного меню. "get Link..." в контекстном меню отображается только при выборе ОДНОГО ФАЙЛА  + (int)EdmMenuFlags.EdmMenu_OnlySingleSelection
                poCmdMgr.AddHook(EdmCmdType.EdmCmd_CardButton);                                                                          //Реагируем по нажатию кнопки в DataCard
            }
            catch (COMException ex)
            {
                string errorName, errorDesc;
                poVault.GetErrorString(ex.ErrorCode, out errorName, out errorDesc);
                poVault.MsgBox(0, errorDesc, EdmMBoxType.EdmMbt_OKOnly, errorName);
            }
        }
Example #19
0
        void IEdmAddIn5.GetAddInInfo(ref EdmAddInInfo poInfo, IEdmVault5 poVault, IEdmCmdMgr5 poCmdMgr)
        {
            string MenuName;

            bool test = false;

            //test = true;

            if (!test)
            {
                poInfo.mbsAddInName = "EpicorIntegration";

                MenuName = "Epicor Integration";
            }
            else
            {
                poInfo.mbsAddInName = "Epicor-Integration";

                MenuName = "Debug";
            }

            poInfo.mbsCompany = "Norco Industries";
            poInfo.mbsDescription = "Epicor Integration Enterprise PDM Add-in";
            poInfo.mlAddInVersion = (int)2015032600;//(int)AssemblyVersion;

            //Minimum Conisio version needed for .Net Add-Ins is 6.4
            poInfo.mlRequiredVersionMajor = 6;
            poInfo.mlRequiredVersionMinor = 4;

            poCmdMgr.AddCmd(1, MenuName + "\\Part Master", (int)EdmMenuFlags.EdmMenu_OnlyFiles + (int)EdmMenuFlags.EdmMenu_MustHaveSelection + (int)EdmMenuFlags.EdmMenu_OnlySingleSelection, "", "Launches a dialog to create/update Item in Epicor", 0, 0); ;

            poCmdMgr.AddCmd(4, MenuName + "\\Add Revision", (int)EdmMenuFlags.EdmMenu_OnlyFiles + (int)EdmMenuFlags.EdmMenu_MustHaveSelection + (int)EdmMenuFlags.EdmMenu_OnlySingleSelection, "", "Launches a dialog to add revision to Item in Epicor", 0, 0);

            poCmdMgr.AddCmd(5, MenuName + "\\Operation Master", (int)EdmMenuFlags.EdmMenu_OnlyFiles + (int)EdmMenuFlags.EdmMenu_MustHaveSelection + (int)EdmMenuFlags.EdmMenu_OnlySingleSelection, "", "Launches a dialog to create/update OOM in Epicor", 0, 0);

            poCmdMgr.AddCmd(6, MenuName + "\\Bill Master", (int)EdmMenuFlags.EdmMenu_OnlyFiles + (int)EdmMenuFlags.EdmMenu_MustHaveSelection + (int)EdmMenuFlags.EdmMenu_OnlySingleSelection, "", "Launches a dialog to create/update BOM in Epicor", 0, 0);

            poCmdMgr.AddCmd(7, MenuName + "\\Check In/Approve Item", (int)EdmMenuFlags.EdmMenu_OnlyFiles + (int)EdmMenuFlags.EdmMenu_MustHaveSelection + (int)EdmMenuFlags.EdmMenu_OnlySingleSelection, "", "Launches a dialog to Approve and Check In Item to Epicor", 0, 0);

            poCmdMgr.AddCmd(-2, MenuName + "\\Calculate Assembly Minutes", (int)EdmMenuFlags.EdmMenu_OnlyFiles + (int)EdmMenuFlags.EdmMenu_MustHaveSelection + (int)EdmMenuFlags.EdmMenu_OnlySingleSelection, "", "Launches a dialog to Approve and Check In Item to Epicor", 0, 0);

            poCmdMgr.AddCmd(3, MenuName + "\\Check Out Item", (int)EdmMenuFlags.EdmMenu_OnlyFiles + (int)EdmMenuFlags.EdmMenu_MustHaveSelection + (int)EdmMenuFlags.EdmMenu_OnlySingleSelection, "", "Checks out Item in Epicor (Not Enterprise PDM)", 0, 0);

            poCmdMgr.AddCmd(0, MenuName + "\\RevCompare", (int)EdmMenuFlags.EdmMenu_Nothing + (int)EdmMenuFlags.EdmMenu_OnlySingleSelection, "", "Launches a dialog to compare previous revisions to the current SolidWorks bill", 0, 0);

            poCmdMgr.AddCmd(-1, MenuName + "\\Add-in Configuration", (int)EdmMenuFlags.EdmMenu_Nothing, "", "Launches a dialog to configure Epicor Integration Add-in", 0, 0);

            poCmdMgr.AddCmd(-10, MenuName + "\\Update Properties from Epicor", (int)EdmMenuFlags.EdmMenu_OnlyFiles + (int)EdmMenuFlags.EdmMenu_MustHaveSelection + (int)EdmMenuFlags.EdmMenu_OnlySingleSelection, "", "Launches a dialog to update file properties from current Epicor values", 0, 0);

            poCmdMgr.AddCmd(-100, MenuName + "\\Templates", (int)EdmMenuFlags.EdmMenu_Nothing, "", "Launches a dialog to Add/Edit/Update Templates", 0, 0);

            //poCmdMgr.AddCmd(-101, MenuName + "\\Search", (int)EdmMenuFlags.EdmMenu_Nothing, "", "Temp", 0, 0);

            poCmdMgr.AddCmd(2, MenuName + "\\Add Item,OOM & BOM", (int)EdmMenuFlags.EdmMenu_OnlyFiles + (int)EdmMenuFlags.EdmMenu_MustHaveSelection + (int)EdmMenuFlags.EdmMenu_OnlySingleSelection, "", "Launches a dialog to add an Item, a revision, an OOM and BOM in Epicor", 0, 0);

            poCmdMgr.AddHook(EdmCmdType.EdmCmd_Menu, null);

            Bill = new List<BillItem>();
        }