14 Replies Latest reply on Feb 8, 2013 2:40 PM by dhollebeek

    ProcessBook Toolbar Add-in Problems.

    JanRuneBjorkelo

      I've recently attempted to create a custom toolbar add-in based on the Osisoft template / Builder's Cafe Webinar posted here in the Virtual Campus. 

       

      However, I can't get the add-in template to show up in the ProcessBook Add-in Menu, nor to work in general.
      The following is what I've been doing so far:

       

      1) Create a new project based on the Toolbar Template in Visual Studio 2005 (VB.NET)
      2) Build the .dll
      3) Move the .dll and dependencies to the C:\Program Files (x86)\PIPC\Procbook folder
      4) Register the .dll using regasm32 in Visual Studio 2005 Command Prompt
      5) Launch ProcessBook 

       

      Are there any obvious steps that I have overlooked?
      Note that the .dll is built from the default template, and both PB and VS2005 CMD runs as administrator on Win7.

       

      I would appreciate any insight and pointers you can provide.

        • Re: ProcessBook Toolbar Add-in Problems.
          andreas

          Have you executed the AddinReg.reg file during the build? Can you check that the registry entries are added and valid?

            • Re: ProcessBook Toolbar Add-in Problems.
              JanRuneBjorkelo

              Hello Andreas,

               

              Yes, I executed the AddinReg.reg file manually after the build was complete.

               

              I've attached a screenshot of the registry entry in question.

               

              I can't really say what could be wrong with the entries though, as I don't have much to compare it to.

               

              Any ideas?

               

              By the way, shouldn't all the default addins for PB also have entries in the same location as the new addin?

               

              Thanks for your assistance.

                • Re: ProcessBook Toolbar Add-in Problems.
                  JanRuneBjorkelo

                  Still having issues to get the add-in to show up in ProcessBook.

                   

                  Anyone have any ideas?

                    • Re: ProcessBook Toolbar Add-in Problems.
                      Asle Frantzen

                      Just a quick suggestion: When you first created a project from that template you should have seen some regions called "command bar" (at least if we're talking about the same template), inside the Connect.cs file. I see three regions regarding this, in addition to the initialization of the "PBCommandBarControl" object. Just make sure everything is untouched there.

                       

                      (For comparison - create a new, empty project from the same template, and make sure that works)

                        • Re: ProcessBook Toolbar Add-in Problems.
                          dhollebeek

                          It looks like you are using a 64-bit OS.  Please check to make sure that the AddInReg.reg file puts entries both in the normal HKLM spot and also in Wow6432Node.  See msdn.microsoft.com/.../ms724072(v=vs.85).aspx for more info on registry entries on a 64-bit system.  PB is a 32-bit application so it only looks in the 32-bit section of the registry.

                            • Re: ProcessBook Toolbar Add-in Problems.
                              JanRuneBjorkelo

                              David,

                               

                              Once I added an identical registry entry to the Wow6432Node subfolder, the addin loaded just fine.

                               

                              Thank you very much (all of you). :)

                                • Re: ProcessBook Toolbar Add-in Problems.
                                  Asle Frantzen

                                  Been there, done that...

                                   

                                  If you do this through code (and not the installer) you can use this one to get the appropriate folder:

                                   
                                  string systemFolder = Environment.Is64BitOperatingSystem ? Environment.GetFolderPath(Environment.SpecialFolder.SystemX86, Environment.SpecialFolderOption.None) : Environment.GetFolderPath(Environment.SpecialFolder.System, Environment.SpecialFolderOption.None);
                                  

                                   

                                    • Re: ProcessBook Toolbar Add-in Problems.
                                      JanRuneBjorkelo

                                      Thank you for your suggestions and help, but I've encountered a new problem that I'm hoping you can assist me with.
                                      As far as I've been able to determine from the PB Programmers Reference and vCampus, it should be possible to set the tag name of a value symbol with the .SetTagName syntax (as shown in the below example).
                                      However, Visual Studio does not present it as a viable option, nor does it work.

                                       

                                      Is there any example code available for setting tag names of value symbols?
                                      Or alternatively do you have any idea as to what is wrong with the syntax? 

                                       
                                      using System; 
                                      using System.Collections; 
                                      using System.Drawing; 
                                      using System.Runtime.InteropServices; 
                                      using System.Windows.Forms; 
                                      using Extensibility; 
                                      using PBObjLib; 
                                      using PBSymLib;
                                      
                                      private PBObjLib.Application app;
                                      private PBObjLib.Symbol lineValue;
                                      lineValue = this.app.ActiveDisplay.Symbols.Add(PBObjLib.pbSYMBOLTYPE.pbSymbolValue); 
                                      lineValue.LineColor = 0; 
                                      lineValue.FillColor = -1; 
                                      lineValue.BackgroundColor = -1; 
                                      lineValue.Top = yPos; 
                                      lineValue.Left = xPos; 
                                      lineValue.Font.Size = 12; 
                                      lineValue.SetTagName("
                                      \\servername\sinusoid")
                                      

                                      I've also run into some issues with setting multistate properties (tagnames, colors, etc) to simple symbols.
                                      Any hints or tips would be much appreciated (see example code below).

                                       
                                      private PBObjLib.MultiState testMultiState;
                                      private PBObjLib.MSState testMultiStateState;
                                      private PBObjLib.Symbo ellipse1;
                                      ellipse1 = this.app.ActiveDisplay.Symbols.Add(PBObjLib.pbSYMBOLTYPE.pbSymbolEllipse);
                                      testMultiState = ellipse1.CreateMultiState("\\servername\sinusoid");
                                      ellipse1.SetMultiState(testMultiState);
                                      testMultiState.StateCount = 3;
                                      testMultiStateState = testMultiState.GetState(1);
                                      testMultiStateState.DefineState(0,0,0);
                                      testMultiStateState = testMultiState.GetState(2);
                                      testMultiStateState.DefineState(1,1,0);
                                      testMultiStateState = testMultiState.GetState(3);
                                      testMultiStateState.DefineState(2,2,0);
                                      

                                      Again, thank you for your assistance!

                        • Re: ProcessBook Toolbar Add-in Problems.
                          dhollebeek

                          private PBSymLib.Value linevalue;

                           

                          linvalue = this.app.ActiveDisplay.Symbols.Add(PBObjLib.pbSYMBOLTYPE.pbSymbolValue) as PBSymLib.Value;

                            • Re: ProcessBook Toolbar Add-in Problems.
                              JanRuneBjorkelo

                              David,

                               

                              Thank you for your suggestion.

                               

                              It worked like a charm! :)

                               

                              Best regards

                                • Re: ProcessBook Toolbar Add-in Problems.
                                  JanRuneBjorkelo

                                  Hello vCampus,

                                   

                                  I have another question regarding symbol properties (C#).
                                  For test purposes I've attempted to create a three point polygon with set coordinates on each node, but I'm not able to create polygons with less than 5 nodes.
                                  However, when I do this manually in Processbook, I manage to create 3 point polygons.
                                  The following is the code that I've been using, which results in a polygon with a mixof my defined points and default points:

                                   
                                  private PBSymLib.Polygon triangle;
                                  triangle = this.app.ActiveDisplay.Symbols.Add(PBObjLib.pbSYMBOLTYPE.pbSymbolPolygon) as PBSymLib.Polygon;
                                   // I set the three nodes that will define the polygon.
                                  triangle.Endpoints.Insert(1, -14000, 14000);
                                  triangle.Endpoints.Insert(2, -13500, 14000);
                                  triangle.Endpoints.Insert(3, -13750, 13500);
                                  // I attempt to remove the five points that the polygons seem to start out with.
                                  triangle.Endpoints.Remove(4);
                                  triangle.Endpoints.Remove(5);
                                  triangle.Endpoints.Remove(6);
                                  triangle.Endpoints.Remove(7);
                                  triangle.Endpoints.Remove(8);
                                  

                                  Anyone have a clue to why this is occuring, or perhaps an alternative approach to creating polygons with 3 nodes?

                                    • Re: ProcessBook Toolbar Add-in Problems.
                                      dhollebeek

                                      The problem is that at the end when you remove point 4, the later ones all shift up by one, so by the time you get to the end, there is no point 8.  Do this instead:

                                       
                                      private PBSymLib.Polygon triangle;
                                      triangle = this.app.ActiveDisplay.Symbols.Add(PBObjLib.pbSYMBOLTYPE.pbSymbolPolygon) as PBSymLib.Polygon;
                                      
                                      triangle.EndPoints.Insert(1, -14000, 14000);
                                      triangle.EndPoints.Insert(2, -13500, 14000);
                                      triangle.EndPoints.Insert(3, -13750, 13500);
                                      triangle.EndPoints.Remove(4); 
                                      triangle.EndPoints.Remove(4); 
                                      triangle.EndPoints.Remove(4); 
                                      triangle.EndPoints.Remove(4); 
                                      triangle.EndPoints.Remove(4);