EdgeBarPage bug

Creator
Creator

Hello,

 

I am experiencing lots of issue related to the EdgeBarPage, I am wondering is the issues is coming  for SE API or the community wrapper.

 

Bug1:

 

* Open an Assembly , select a Par file , Right Click Open

* OnCreateEdgeBarPage is called for the new windows

* When I close the par file Disclose event is called correcly

OnCreateEdgeBarPage is again called for the assembly which does not make any sense.

 

It cause huge problem because it overlap the current edgebar and you start getting really weird errors.

it is quite easy to fix in the OnCreateEdgeBarPage

 

 

public override void OnCreateEdgeBarPage(SolidEdgeCommunity.AddIn.EdgeBarController controller, SolidEdgeFramework.SolidEdgeDocument document)
    {
    ....

      foreach(var var in controller.EdgeBarPages )
      {
        if (var.Document == document)
          return;
      }
....

    }

 

 

Bug 2:

 

* Open an Assembly , select a Par file , Right Click Edit

* OnCreateEdgeBarPage is called for the inplace Edit

* When I close the par file Disclose event is never called, you end up with ghost EdgeBarPage

* if you Right Click Edit, OnCreateEdgeBarPage is created again and left there when exiting.

 

From here own I need to be really carefull when interacting with EdgeBarPages

I basically need to check which edgebar is currently active EdgeBarpage.Document.

 

 

 public void BeforeSave()
    {
      string fullName = (MyAddIn.Instance.Application.GetActiveDocument() as SolidEdgeDocument).FullName;
      foreach (var ctrl in MyAddIn.Instance.EdgeBarController.EdgeBarPages)
      {
        if (ctrl.Document.FullName != fullName)
          continue;

        if (ctrl.Control is PropBarControl)
        {
          PropBarControl barCtrl = ctrl.Control as PropBarControl;

          if (barCtrl != null)
          {
            if (currentDocument != null)
              cache = barCtrl.CacheProperties(currentDocument);

            barCtrl.SaveCachedProperties();
          }
        }
      }

 

 

I was wondering if other people are experiencing same issue. Do you think that those issue are API or SolidEdge.Community API ? 

 

Is there any example to creating C# addin from scratch without using SolidEdge.Community API I could check at least if the bug are from SE API and send SR request.

 

Thanks,

/Eric

2 REPLIES

Re: EdgeBarPage bug

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Eric,

 

I will look into what you've described over the weekend and let you know what I think.

Jason Newell
Applications Architect
www.jasonnewell.net

Re: EdgeBarPage bug

Creator
Creator

Hello Jason,

 

Thanks, I can create a video if needed to explain the issue in more details.

I will try to compile the SolidEdge.community dlls and debug it.

 

/Eric