4 Replies Latest reply on Aug 7, 2013 2:21 PM by francois_ruel

    ProcessBook - Build Composite Symbols in Addin

    francois_ruel

      Hi, 

       

      We are facing a issue creating composite symbols in ProcessBook

       
      Composite c = (Composite)aDisplay.Symbols.Add(PBObjLib.pbSYMBOLTYPE.pbSymbolComposite);
      
      // or next line code giving same issue
      
      Composite c = new Composite() 
      

       In debug  we receive this error

       
      Call stack location:
      
      OSISoft.PISDK.Controls.PIArchiveEditor.dll!OSISoft.PISDK.Control.PIArchiveEditor.PIValuesConllection.set(PISDK.PIValues value = null) Line 2046
      

       

       
      Source file information:
      
      
      Locating source for 'C:\dev\pi\clients\PISDKControls\Source_1.4.0_Fixes\PIArchiveEditor\PIArchiveEditor.cs'. Checksum: MD5 {34 85 d2 3 63 5f ae b5 99 57 f ba 3b 35 b2 3a}
      The file 'C:\dev\pi\clients\PISDKControls\Source_1.4.0_Fixes\PIArchiveEditor\PIArchiveEditor.cs' does not exist.
      Looking in script documents for 'C:\dev\pi\clients\PISDKControls\Source_1.4.0_Fixes\PIArchiveEditor\PIArchiveEditor.cs'...
      Looking in the projects for 'C:\dev\pi\clients\PISDKControls\Source_1.4.0_Fixes\PIArchiveEditor\PIArchiveEditor.cs'.
      The file was not found in a project.
      Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\crt\src\'...
      Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc\'...
      Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\atl\'...
      Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\'...
      The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: C:\dev\pi\clients\PISDKControls\Source_1.4.0_Fixes\PIArchiveEditor\PIArchiveEditor.cs.
      The debugger could not locate the source file 'C:\dev\pi\clients\PISDKControls\Source_1.4.0_Fixes\PIArchiveEditor\PIArchiveEditor.cs'.
      

       

       

      Is it possible to Create Composite on a Processbook a display?

       

      Thanks

       

       

        • Re: ProcessBook - Build Composite Symbols in Addin

          A Composite symbol is the grouping of existing symbols. So you would create a Composite symbol by grouping selected symbols on the display.

           

          aDisplay.SelectedSymbols.Group

            • Re: ProcessBook - Build Composite Symbols in Addin
              francois_ruel

              Thanks for your reply.

               

              I change my way, I use SymbolAttachment instead of grouping.

               

              Do you know how to delete a Symbol on a Display?

               

              I tried this, but object is still there. 

               

               

               
              void app_OpenDisplay(Display aDisplay)
              
              {
              
                // Delete object dupMaster
              
                Symbol symToDelete = aDisplay.Symbols.item("dupMaster");
              
                if (symToDelete != null)
              
                  aDisplay.Symbols.Remove(symToDelete);
              
              
                //Look if object is still there
              
                symToDelete = aDisplay.Symbols.item("dupMaster");
              
                if (symToDelete != null)
              
                  MessageBox.Show("dupMaster is still there");
              
              
              
                ...
              
              
              
              } 
              

               

               

              Thanks

                • Re: ProcessBook - Build Composite Symbols in Addin
                  francois_ruel

                  Sorry for the code display

                   

                   

                   
                  void app_OpenDisplay(Display aDisplay)
                  {
                      // Delete object dupMaster
                      Symbol symToDelete = aDisplay.Symbols.item("dupMaster");
                      if (symToDelete != null)
                          aDisplay.Symbols.Remove(symToDelete);
                      //Look if object is still there
                      symToDelete = aDisplay.Symbols.item("dupMaster");
                      if (symToDelete != null)
                          MessageBox.Show("dupMaster is still there");
                      ...
                  }
                  

                   

                    • Re: ProcessBook - Build Composite Symbols in Addin
                      francois_ruel

                      I found in an other thread

                       

                      We need to pass the name of the object and not the object it self

                       
                      void app_OpenDisplay(Display aDisplay)
                      {
                          // Delete object dupMaster
                          Symbol symToDelete = aDisplay.Symbols.item("dupMaster");
                          if (symToDelete != null)
                          {
                              ...
                              aDisplay.Symbols.Remove(symToDelete.Name);
                          }
                      
                          ...
                      }
                      

                       Thanks