Пример #1
0
        /// <summary>
        /// Called when Solid Edge raises the SolidEdgeFramework.ISEAddInEdgeBarEvents[Ex].AddPage() event.
        /// </summary>
        public override void OnCreateEdgeBarPage(SolidEdgeCommunity.AddIn.EdgeBarController controller, SolidEdgeFramework.SolidEdgeDocument document)
        {
            // Note: Confirmed with Solid Edge development, OnCreateEdgeBarPage does not get called when Solid Edge is first open and the first document is open.
            // i.e. Under the hood, SolidEdgeFramework.ISEAddInEdgeBarEvents[Ex].AddPage() is not getting called.
            // As an alternative, you can call DemoAddIn.Instance.EdgeBarController.Add() in some other event if you need.

            // Get the document type of the passed in document.
            var documentType = document.Type;
            var imageId = 1;

            // Depending on the document type, you may have different edgebar controls.
            switch (documentType)
            {
                case SolidEdgeFramework.DocumentTypeConstants.igAssemblyDocument:
                case SolidEdgeFramework.DocumentTypeConstants.igDraftDocument:
                case SolidEdgeFramework.DocumentTypeConstants.igPartDocument:
                case SolidEdgeFramework.DocumentTypeConstants.igSheetMetalDocument:
                    controller.Add<MyEdgeBarControl>(document, imageId);
                    break;
            }
        }
Пример #2
0
 /// <summary>
 /// Called directly after OnConnectToEnvironment() to give you an opportunity to configure a ribbon for a specific environment.
 /// </summary>
 public override void OnCreateRibbon(SolidEdgeCommunity.AddIn.RibbonController controller, Guid environmentCategory, bool firstTime)
 {
     // Depending on environment, you may or may not want to load different ribbons.
     if (environmentCategory.Equals(SolidEdgeSDK.EnvironmentCategories.Assembly))
     {
         // Assembly Environment
         controller.Add<Ribbon3d>(environmentCategory, firstTime);
     }
     else if (environmentCategory.Equals(SolidEdgeSDK.EnvironmentCategories.Draft))
     {
         // Draft Environment
         controller.Add<Ribbon2d>(environmentCategory, firstTime);
     }
     else if (environmentCategory.Equals(SolidEdgeSDK.EnvironmentCategories.Part))
     {
         // Traditional Part Environment
         controller.Add<Ribbon3d>(environmentCategory, firstTime);
     }
     else if (environmentCategory.Equals(SolidEdgeSDK.EnvironmentCategories.DMPart))
     {
         // Synchronous Part Environment
         controller.Add<Ribbon3d>(environmentCategory, firstTime);
     }
     else if (environmentCategory.Equals(SolidEdgeSDK.EnvironmentCategories.SheetMetal))
     {
         // Traditional SheetMetal Environment
         controller.Add<Ribbon3d>(environmentCategory, firstTime);
     }
     else if (environmentCategory.Equals(SolidEdgeSDK.EnvironmentCategories.DMSheetMetal))
     {
         // Synchronous SheetMetal Environment
         controller.Add<Ribbon3d>(environmentCategory, firstTime);
     }
 }