14 Replies Latest reply on Jun 19, 2017 7:46 AM by cjtx

    Pull component height from PCB database & Library

    cjtx

      Howdy all y'all!

       

           I'm very much a beginner with automation , .net, VB, efm, vbs.   I figured this may be an easier task to start with. I'd like to get the heights for each part and tie to variable or write out to a text file then do something else with it later.  I found the PCB Automation Model 7.9.4.  I'm thinking I need to "call" one of these objects.properties to get the data?   Maybe Component>FindProperty? 

       

       

      So have been throwing some things together below but definitely know I'm missing a lot.  Trying to use a message box now to test but will/can swap this out with some code to write to text instead.   Looking for any help with direction or maybe start over :-)

       

       

       

       

      Option Explicit

      'Add any typ libraries to be used.

      Scripting.AddTypeLibrary("MGCPCB.ExpeditionPCBApplication")

      Scripting.AddTypeLibrary("MGCPCB.PlannerPCBApplication")

       

      ' Get the Application object

      Dim pcbAppObj

      Dim filesys

      Dim compheightfile

      'Set pcbAppObj = Application 

      'On error resume next

      'Set pcbAppObj = GetObject(,"MGCPCB.ExpeditionPCBApplication")

      'If (Err) then

        'If won't open in Expedition try Planner

      Set pcbAppObj = GetObject(,"MGCPCB.Application")

      Set filesys = CreateObject("Scripting.FileSystemObject")

      Set compheightfile = filesys.CreateTextFile("./compmaxheights.txt", True)

      ' Err.clear

      'end if

      ' Get the active document

      Dim pcbDocObj

      Set pcbDocObj = pcbAppObj.ActiveDocument

       

      ' License the document

      ValidateServer(pcbDocObj)

       

       

      'Get the parts collection

      Dim partsColl: Set partsColl = pcbDocObj.Parts

       

      '

      Dim Coll

      Dim i, j

      Dim cmpObj

      Dim Height

      Dim refDes

       

       

       

       

       

      partsColl.Item(i).Height(epcbUnitMils)

       

       

      Dim compmaxheightinfo

      compmaxheightinfo = "Height (mils): " & vbCRLF & refDes & vbTab & Height & vbCRLF & vbCRLF & "Height (mils): "_

      & vbCRLF & refDes & vbTab & Height & vbCRLF'vbCRLF & vbCRLF_

      '& "Height (mils): " & vbCRLF & refDes & vbTab & Height & vbCRLF

       

      'msgbox compheightinfo  '"Height: " & vbCRLF & refDes & ", " & Height & " mils" & vbCRLF & vbCRLF_

               '& "Height: " &vbCRLF & refDes& ", "  & " mils"

      compheightfile.WriteLine compheightinfo

        • 1. Re: Pull component height from PCB database & Library
          jeff@viavi

          Here is some code I did a long time ago that gets the height of part number on a design and puts it into an Excel Spreadsheet

           

          Get_Height
          Sub main()
              Get_Height
          End Sub

          Sub Get_Height()
              Dim pcbApp 'As MGCPCB.Application
              Dim pcbDoc 'As MGCPCB.Document
              Set pcbApp = GetObject(, "MGCPCB.Application")
              Set pcbDoc = pcbApp.ActiveDocument
              Dim xls 'As Excel.Application
              Set xls = CreateObject("Excel.Application")
              xls.Visible = True
              xls.Workbooks.Add
             
              ' get a doc licence
            ' License the document
              ValidateServer(pcbDoc)
              Dim prts 'As MGCPCB.Parts
              Dim prt 'As MGCPCB.Part
              Set prts = pcbDoc.Parts
              prts.Sort

              ' Define Header

              i = 2
              xls.Range("A1").FormulaR1C1 = "part Number"
              xls.Range("B1").FormulaR1C1 = "No. of parts"
              xls.Range("C1").FormulaR1C1 = "Height"
              xls.Range("D1").FormulaR1C1 = "Underside Height"

              For Each prt In prts

                  xls.Range("A" & i).FormulaR1C1 = prt.Name
                  xls.Range("B" & i).FormulaR1C1 = prt.Components.Count
             
                  Dim comps 'As Components
                  Dim comp 'As Component
                  Dim po 'As PlacementOutline
                  Dim pos 'As PlacementOutlines
             
                  Set comps = prt.Components

                  For Each comp In comps
                      Set pos = comp.PlacementOutlines

                      For Each po In pos
                          xls.Range("C" & i).FormulaR1C1 = po.Height(epcbUnitCurrent)
                          xls.Range("D" & i).FormulaR1C1 = po.UndersideSpace
                      Next
                  Next

                  On Error Resume Next
                  i = i + 1

              Next

              MsgBox "Done!"

          End Sub

          ' Function to validate the server.
          Private Function ValidateServer(doc)
             
              dim key, licenseServer, licenseToken

              ' Ask Expedition’s document for the key
              key = doc.Validate(0)

              ' Get license server
              Set licenseServer = CreateObject("MGCPCBAutomationLicensing.Application")

              ' Ask the license server for the license token
              licenseToken = licenseServer.GetToken(key)

              ' Release license server
              Set licenseServer = nothing

              ' Turn off error messages.  Validate may fail if the token is incorrect
              On Error Resume Next
              Err.Clear

              ' Ask the document to validate the license token
              doc.Validate(licenseToken)
              If Err Then
                  ValidateServer = 0   
              Else
                  ValidateServer = 1
              End If

          End Function

          2 of 2 people found this helpful
          • 2. Re: Pull component height from PCB database & Library
            jharames

            Hey Cameron, Jayson here.  Are you trying to write the code for a PCB layout or for PDB parts in the library?  I left some code behind that will export parts out of a design and populate a side and height in a spread sheet. 

            1 of 1 people found this helpful
            • 3. Re: Pull component height from PCB database & Library
              jharames

              Also here is something from Al Layson on another post that maybe what you are after for the library.  You will have to modify it to your needs, but the ideas of looping through each property is what you want.  The connector part to the PDBs in the lib will get you on your way.

               

              Please copy the following code to a .vbs file. Then Open PCB in xPCB Layout VX.1.1 and execute Setup > xDM Library Tools...When the tool has opened, open this script via File > Open Script Form and execute "Run". If this script does not run properly, then you will need a stand alone xDM Library Tools license in order to access automation for xDM Library Tools.

               

              Dim fso: Set fso = CreateObject("Scripting.FileSystemObject")
              Dim file
              Dim sComVersion : sComVersion = Scripting.GetEnvVariable("EXP_PROG_ID_VER") : If sComVersion = "" Then sComVersion = "1"
              'SlotPins
              Set SlotPins=CreateObject("Scripting.Dictionary")

              main()

              Sub main
              Dim libApp: Set libApp=Application
              Dim LibDoc: Set LibDoc=libApp.ActiveLibrary
              Dim LibFullName: LibFullName=LibDoc.FullName
              Dim LibPath: LibPath=LibDoc.Path
              'Create & open the output text file for writing
              Dim sFilename
              sFilename=LibPath & "LogFiles\CreateWBPads.txt"
              Set file = fso.CreateTextFile(sFilename, True)

               

              file.writeline(LibFullName)
              file.writeblanklines(1)

              'Get the PartEditor and its TypeLibrary
              Dim partEdObj
              Set partEdObj = LibDoc.PartEditor
              If partEdObj Is Nothing Then
                msgbox("ERROR: Unable to Open the Cell Editor")
                Exit sub
              End If
              Scripting.AddTypeLibrary("MGCPCBLibraries.PartsEditorDlg." + sComVersion)

              ' Get the parts database for the design
              Dim PDB
              Set PDB = partEdObj.ActiveDatabase

               

              'Do for each partition 
              Dim partition,part
              For Each partition In PDB.Partitions
                file.writeline("Partition : " + partition.name + "........................................................")
                file.writeblanklines(1)
                For Each part In partition.parts
                 RptPins(part) 
                Next
              Next

              partEdObj.Quit()
              Set partEdObj=Nothing

              'Close and open our logfile
              file.Close
                  Dim WshShell
                  Set WshShell = CreateObject("WScript.Shell")
              WshShell.Run sFilename

              End Sub

               

              Sub RptPins(part)
              Dim gate,slotnum,slot,pin,pd,pintype,cell,nc,nr,sup,prop,sym,line
              file.writeline("Part Number : " & part.Number)
              file.writeline("     Name : " & part.Name)
              file.writeline("     Label : " & part.Label)
              file.writeline("     Description : " & part.Description)
              file.writeline("     Part Incomplete : " & part.Incomplete)
              file.writeline("     Part Type : " & part.TypeString)
              file.writeline("     RefDes Prefix : " & part.RefDesPrefix)
              file.writeline("     Verified : " & part.Verified)
              file.writeline("     Number of Pins : " & part.pinmapping.PinCount)
              For Each prop In part.properties
                file.writeline("     " & prop.Name & " = " & prop.Value)
              Next
              file.writeline("     Symbol References")
              For Each sym In part.SymbolReferences
                file.writeline("         Symbol : " & sym.Name)
              Next
              file.writeline("     Cell References")
              For Each cell In part.CellReferences
                file.writeline("         Cell : " & cell.Name)
              Next
              file.writeblanklines(1)
              End Sub

               

              2 of 2 people found this helpful
              • 4. Re: Pull component height from PCB database & Library
                Patrick.Cashman

                Both previous replies have very useful information in them. 

                 

                Here are a couple of examples and a few tips:

                 

                1. Gather info into a string variable:

                Sub get_component_heights_1()

                 

                        Dim comps As MGCPCB.Components

                 

                        Dim comp As MGCPCB.Component

                 

                        Dim str, not_str, ht As String

                 

                        Dim props As MGCPCB.Properties

                 

                        Dim prop As MGCPCB.Property

                 

                       

                 

                        comps = doc.Components(0)

                 

                        str = "Component Heights:" & vbCrLf & vbCrLf

                 

                        not_str = "Components with no Height Property: " & vbCrLf & vbCrLf

                 

                        For Each comp In comps

                 

                            prop = Nothing

                 

                            prop = comp.FindProperty("Height")

                 

                            If Not prop is Nothing Then

                 

                                str = str & comp.RefDes & vbTab & "Height: " & vbTab & prop.Value & vbCrLf

                 

                            Else

                 

                                not_str = not_str & comp.RefDes & vbCrLf

                 

                            End If

                 

                        Next

                 

                       

                 

                        str = str & vbCrLf & vbCrLf & not_str

                 

                        Debug.Print(str)

                 

                End Sub

                2. Use a stringbuilder (vb.net only) instead:

                Sub get_component_heights()

                 

                        Dim comps As MGCPCB.Components

                 

                        Dim comp As MGCPCB.Component

                 

                        Dim str As New StringBuilder

                 

                        Dim not_str As New StringBuilder

                 

                        Dim props As MGCPCB.Properties

                 

                        Dim prop As MGCPCB.Property

                 

                       

                 

                        comps = doc.Components(0)

                 

                        str.Length = 0

                 

                        not_str.Length = 0

                 

                        str.Append("Component Heights:" & vbCrLf & vbCrLf)

                 

                        not_str.Append("Components with no Height Property: " & vbCrLf & vbCrLf)

                 

                        For Each comp In comps

                 

                            prop = Nothing

                 

                            prop = comp.FindProperty("Height")

                 

                            If Not prop is Nothing Then

                 

                                str.AppendLine(comp.RefDes & vbTab & "Height: " & vbTab & prop.Value)

                 

                            Else

                 

                                not_str.AppendLine(comp.RefDes)

                 

                            End If

                 

                        Next

                 

                       

                 

                        str.Append(vbCrLf & vbCrLf)

                 

                        str.AppendLine(not_str.ToString)

                 

                       

                 

                        Debug.Print(str.ToString)

                 

                End Sub

                Both of these examples assume you have the automation hooks in place (get the pcbapp and pcbdoc objects) already and they are defined as global variables, thus accessible from within any subroutine. In my examples I use doc instead of pcbdoc.  Less typing .

                 

                Note - these examples are from VB.net.  There are some differences in vbscript.  You'll notice all the variables are declared with a datatype.  In vbscript, there is no datatype included in the declarations.

                 

                One thing I'll mention regarding string variables and long lists of information.  Strings are immutable.  That means you can't add to them.  In reality you can, but behind the scenes you can't. What actually takes place when you add to a string is that the string variable is destroyed and a new one with the same name is added, with the new information added to it. The practical result of this is that if you are gathering a lot of data into a string, the process gets slower and slower. The string keeps on rebuilding itself from scratch with ever larger amounts of data in the value every time.  If you add a status bar to your form, you can see the speed getting slower and slower. That's why I use the stringbuilder.  It's a different kind of variable, and is not immutable.  This means it's faster. You can add to it to your heart's content and no matter how big it is, it takes the same amount of time every time.

                1 of 1 people found this helpful
                • 5. Re: Pull component height from PCB database & Library
                  jeff@viavi

                  Hey Jayson,

                  Where are you working now days?

                  • 6. Re: Pull component height from PCB database & Library
                    jharames

                    A start up company called Secturion.  Hardware accelerated encryption, to keep you data secure.  I'm enjoying the change of pace.  How's life for you.

                     

                     

                    Sent on a Sprint Samsung Galaxy Note® 3

                    • 7. Re: Pull component height from PCB database & Library
                      cjtx

                      Super awesome this works great, thanks for sharing! 

                      • 8. Re: Pull component height from PCB database & Library
                        cjtx

                        Thanks Jayson! We do not have XDM Library Automation license as of yet unfortunately so not able to run that code. I'm going ask about getting this but might have to look into another path.  I am still studying a lot of the existing code here, will take much more time to absorb it at my current level.  I'm planning to take some courses to hopefully get a little better understanding of this fun stuff!         

                        • 9. Re: Pull component height from PCB database & Library
                          cjtx

                          Was having some errors on these, pretty sure It's because I don't have the automation hooks in right. I have a little time today to try at it some more.  For the second example I'm thinking I need to paste it inside of your vb.net automation template?  Believe your template has the hooks I'm missing?   I think this is how I started but 'll try this again and post some of the errors If they are still happening.  Thanks for the help!!

                          • 10. Re: Pull component height from PCB database & Library
                            Patrick.Cashman

                            Yes you would use the 2nd example I posted, with the stringbuilder.  The typical way this would be done is to add a button and a text box to the form (MainForm or Main_Form) of a copy of the template project.  After you add the button, double click it and then paste the name of the subroutine you want to run with it (get_component_heights) into the subroutine which is automatically created as the click event of the button. 

                             

                            Then instead of displaying the results to the debug window, display them in the text box, by changing the line that says

                             

                            Debug.Print(str.ToString)

                             

                            to

                             

                            textbox1.text = str.ToString

                            (or whatever the name of your text box is)

                             

                            Be sure to set the multiline property of the text box to true, or else it will only want to be 1 line tall.

                            1 of 1 people found this helpful
                            • 11. Re: Pull component height from PCB database & Library
                              cjtx

                              Thanks Patrick!  making some progress now.  I think I just need to get past some of the errors/dependencies listed in the table below.  I know I've seen problems with viewdraw before with VB.   Should the template be able to compile and run as is before adding any code or form objects?     Looks like some things need to registered aswell, whatever that means.   

                               

                               

                               

                              If I click yes here:

                               

                               

                               

                              I get this:

                               

                              Believe this is what I should see if it was to build successfully?  

                               

                               

                               

                               

                               

                               

                              Also thinking some paths/libraries need to be corrected?

                               

                               

                              1>------ Build started: Project: Automation_Template, Configuration: Debug x86 ------

                               

                              1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2398,5): warning MSB3284: Cannot get the file path for type library "ededed00-d5f6-4b04-8fe7-ededededed00" version 26.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

                               

                              1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2398,5): warning MSB3284: Cannot get the file path for type library "a15934bc-ad3f-4c25-a144-1b17559cb862" version 1.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

                               

                              1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2398,5): warning MSB3284: Cannot get the file path for type library "a65645ee-0acb-4429-9888-f23939235bc3" version 26.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

                               

                              1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2398,5): warning MSB3284: Cannot get the file path for type library "786637f2-9407-11d2-89d9-0020184077e1" version 1.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

                               

                              1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2398,5): warning MSB3284: Cannot get the file path for type library "f7b48a3d-3d87-49e4-9edb-14bdb1bdf4c9" version 1.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

                               

                              1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2398,5): warning MSB3284: Cannot get the file path for type library "b1b1fcfe-cf8d-426b-94b6-8db50dcdb5ad" version 1.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

                               

                              1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2398,5): warning MSB3284: Cannot get the file path for type library "b385493f-aa5a-455b-b123-49a5a98d0541" version 1.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

                               

                              1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2398,5): warning MSB3284: Cannot get the file path for type library "06e4c7f4-fc79-4c1e-86db-a0bf939e03f2" version 1.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

                               

                              1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2398,5): warning MSB3284: Cannot get the file path for type library "4adef4e1-690a-11ce-9261-0020c5e26659" version 26.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

                               

                              1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2398,5): warning MSB3284: Cannot get the file path for type library "b74f7591-f64c-43df-945a-519da50abafa" version 1.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

                               

                              1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2398,5): warning MSB3284: Cannot get the file path for type library "c6369ff8-07f3-45a7-9e65-28476752e83b" version 1.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

                               

                              1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2398,5): warning MSB3304: Could not determine the dependencies of the COM reference "MGVmgrObjs4". Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY))

                               

                              1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(2398,5): warning MSB3290: Failed to create the wrapper assembly for type library "MGVmgrObjs4". Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY))

                               

                              1>C:\DEV\dotnetautotemplate\mod_Automation_Module.vb(25,21): error BC30002: Type 'ViewDraw.Application' is not defined.

                               

                              1>C:\DEV\dotnetautotemplate\mod_Automation_Module.vb(27,20): error BC30002: Type 'ViewDraw.IVdView' is not defined.

                               

                              1>C:\DEV\dotnetautotemplate\mod_Automation_Module.vb(28,19): error BC30002: Type 'ViewDraw.IProjectData' is not defined.

                               

                              1>C:\DEV\dotnetautotemplate\mod_Automation_Module.vb(33,22): error BC30002: Type 'MGCPCB.Application' is not defined.

                               

                              1>C:\DEV\dotnetautotemplate\mod_Automation_Module.vb(34,22): error BC30002: Type 'MGCPCB.Document' is not defined.

                               

                              1>C:\DEV\dotnetautotemplate\mod_Automation_Module.vb(38,21): error BC30002: Type 'MGCPCB.DrawingEditorApplication' is not defined.

                               

                              1>C:\DEV\dotnetautotemplate\mod_Automation_Module.vb(39,21): error BC30002: Type 'MGCPCB.Document' is not defined.

                               

                              1>C:\DEV\dotnetautotemplate\mod_Automation_Module.vb(42,22): error BC30002: Type 'MGCPCB.FablinkXEApplication' is not defined.

                               

                              1>C:\DEV\dotnetautotemplate\mod_Automation_Module.vb(43,22): error BC30002: Type 'MGCPCB.Document' is not defined.

                               

                              1>C:\DEV\dotnetautotemplate\mod_Automation_Module.vb(52,21): error BC30002: Type 'MGCVARIANTGUI.VMDocument' is not defined.

                               

                              1>C:\DEV\dotnetautotemplate\mod_Automation_Module.vb(53,21): error BC30002: Type 'MGCVARIANTGUI.Application' is not defined.

                               

                              1>C:\DEV\dotnetautotemplate\mod_Automation_Module.vb(361,48): error BC30002: Type 'MGCPCB.Document' is not defined.

                               

                              ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

                               

                               

                               

                               

                              Severity

                              Code

                              Description

                              Project

                              File

                              Line

                              Warning

                               

                              The referenced component 'MGCPCBAutomationLicensing' could not be found.

                              Automation_Template

                               

                               

                              Error

                              BC30002

                              Type 'ViewDraw.Application' is not defined.

                              Automation_Template

                              C:\DEV\dotnetautotemplate\mod_Automation_Module.vb

                              25

                              Error

                              BC30002

                              Type 'ViewDraw.IVdView' is not defined.

                              Automation_Template

                              C:\DEV\dotnetautotemplate\mod_Automation_Module.vb

                              27

                              Error

                              BC30002

                              Type 'ViewDraw.IProjectData' is not defined.

                              Automation_Template

                              C:\DEV\dotnetautotemplate\mod_Automation_Module.vb

                              28

                              Error

                              BC30002

                              Type 'MGCPCB.Application' is not defined.

                              Automation_Template

                              C:\DEV\dotnetautotemplate\mod_Automation_Module.vb

                              33

                              Error

                              BC30002

                              Type 'MGCPCB.Document' is not defined.

                              Automation_Template

                              C:\DEV\dotnetautotemplate\mod_Automation_Module.vb

                              34

                              Error

                              BC30002

                              Type 'MGCPCB.DrawingEditorApplication' is not defined.

                              Automation_Template

                              C:\DEV\dotnetautotemplate\mod_Automation_Module.vb

                              38

                              Error

                              BC30002

                              Type 'MGCPCB.Document' is not defined.

                              Automation_Template

                              C:\DEV\dotnetautotemplate\mod_Automation_Module.vb

                              39

                              Error

                              BC30002

                              Type 'MGCPCB.FablinkXEApplication' is not defined.

                              Automation_Template

                              C:\DEV\dotnetautotemplate\mod_Automation_Module.vb

                              42

                              Error

                              BC30002

                              Type 'MGCPCB.Document' is not defined.

                              Automation_Template

                              C:\DEV\dotnetautotemplate\mod_Automation_Module.vb

                              43

                              Error

                              BC30002

                              Type 'MGCVARIANTGUI.VMDocument' is not defined.

                              Automation_Template

                              C:\DEV\dotnetautotemplate\mod_Automation_Module.vb

                              52

                              Error

                              BC30002

                              Type 'MGCVARIANTGUI.Application' is not defined.

                              Automation_Template

                              C:\DEV\dotnetautotemplate\mod_Automation_Module.vb

                              53

                              Error

                              BC30002

                              Type 'MGCPCB.Document' is not defined.

                              Automation_Template

                              C:\DEV\dotnetautotemplate\mod_Automation_Module.vb

                              361

                              Warning

                               

                              Cannot get the file path for type library "ededed00-d5f6-4b04-8fe7-ededededed00" version 26.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

                              Automation_Template

                               

                               

                              Warning

                               

                              Cannot get the file path for type library "a15934bc-ad3f-4c25-a144-1b17559cb862" version 1.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

                              Automation_Template

                               

                               

                              Warning

                               

                              Cannot get the file path for type library "a65645ee-0acb-4429-9888-f23939235bc3" version 26.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

                              Automation_Template

                               

                               

                              Warning

                               

                              Cannot get the file path for type library "786637f2-9407-11d2-89d9-0020184077e1" version 1.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

                              Automation_Template

                               

                               

                              Warning

                               

                              Cannot get the file path for type library "f7b48a3d-3d87-49e4-9edb-14bdb1bdf4c9" version 1.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

                              Automation_Template

                               

                               

                              Warning

                               

                              Cannot get the file path for type library "b1b1fcfe-cf8d-426b-94b6-8db50dcdb5ad" version 1.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

                              Automation_Template

                               

                               

                              Warning

                               

                              Cannot get the file path for type library "b385493f-aa5a-455b-b123-49a5a98d0541" version 1.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

                              Automation_Template

                               

                               

                              Warning

                               

                              Cannot get the file path for type library "06e4c7f4-fc79-4c1e-86db-a0bf939e03f2" version 1.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

                              Automation_Template

                               

                               

                              Warning

                               

                              Cannot get the file path for type library "4adef4e1-690a-11ce-9261-0020c5e26659" version 26.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

                              Automation_Template

                               

                               

                              Warning

                               

                              Cannot get the file path for type library "b74f7591-f64c-43df-945a-519da50abafa" version 1.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

                              Automation_Template

                               

                               

                              Warning

                               

                              Cannot get the file path for type library "c6369ff8-07f3-45a7-9e65-28476752e83b" version 1.0. Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))

                              Automation_Template

                               

                               

                              Warning

                               

                              Could not determine the dependencies of the COM reference "MGVmgrObjs4". Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY))

                              Automation_Template

                               

                               

                              Warning

                               

                              Failed to create the wrapper assembly for type library "MGVmgrObjs4". Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY))

                              Automation_Template

                               

                               

                              Warning

                               

                              There are updated custom wrappers available for the following referenced components: Outlook ,Word.

                              Automation_Template

                               

                               

                              Warning

                               

                              The referenced component 'MGCPCB' could not be found.

                              Automation_Template

                               

                               

                              Warning

                               

                              The referenced component 'MGCSDDADDINTREELib' could not be found.

                              Automation_Template

                               

                               

                              Warning

                               

                              The referenced component 'MGCVARIANTGUI' could not be found.

                              Automation_Template

                               

                               

                              Warning

                               

                              The referenced component 'MGCVARIANTMGR' could not be found.

                              Automation_Template

                               

                               

                              Warning

                               

                              The referenced component 'MGCVARIANTMGRSOCKETS' could not be found.

                              Automation_Template

                               

                               

                              Warning

                               

                              The referenced component 'MGCVmgrApplSocksLib' could not be found.

                              Automation_Template

                               

                               

                              Warning

                               

                              The referenced component 'MGCVmgrPCBViewGen' could not be found.

                              Automation_Template

                               

                               

                              Warning

                               

                              The referenced component 'MGCVmgrSetSocksLib' could not be found.

                              Automation_Template

                               

                               

                              Warning

                               

                              The referenced component 'MGVmgrObjs4' could not be found.

                              Automation_Template

                               

                               

                              Warning

                               

                              The referenced component 'ViewDraw' could not be found.

                              Automation_Template

                               

                               

                              Warning

                               

                              The referenced component 'MANAGEMENTLib' could not be found.

                              Automation_Template

                               

                               

                              • 12. Re: Pull component height from PCB database & Library
                                Patrick.Cashman

                                I believe the issue lies with the automation template being built on VX.1.2 dlls, and if I'm not mistaken, you are now using VX.2.x.  Where I work we're currently in the process of upgrading all the scripts to work with .2.1, so when I have some free time I'll update the Automation Template and post it up so you can download it.

                                 

                                The upgrade for the most part entails deleting the references to the old dlls and adding references to the new ones from VX.2.x.  It's a bit tricky though, because some of them do not appear in the normal lists of COM objects, so you either have to hunt them down in the Mentor install tree or get them from some other place.  I am pretty sure I have all of them needed for the latest Mentor tools in VX.2.1, so it should not be hard to update the template with them.  I'll post up here when it's ready for download.

                                • 13. Re: Pull component height from PCB database & Library
                                  Patrick.Cashman

                                  New Automation Template for .2.x is available here.

                                   

                                  More to follow on some issues I'm encountering with some of the .2.1 dll's - PCB Engines and the MaskEngineAutomationController are not working.  I'll make a separate thread about it and hopefully the Mentor folks can chime in and verify or correct me.

                                  • 14. Re: Pull component height from PCB database & Library
                                    cjtx

                                    Thanks Patrick! Not quite to v.2.x yet but hoping to get there soon.