AnsweredAssumed Answered

Copy Component Placement Outline to AssemblyLayer

Question asked by jens.radeloff on Feb 4, 2011
Latest reply on Feb 8, 2011 by jens.radeloff



I just do some first steps in programming MentorExpedition Automation with DotNet (VisualBasicExpress Edition). My Task is to copy the component placement outline to the fabrication Layer AssemblyTop. My problem is an type missmatch error when I call the function "PutFabricationLayerGfx". In my opinion where is a problem with the array but I have no idea which kind of.


The error message says: "Typconflict. (Exception of HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))"


And here is my code extraction:

For Each component In PCBDoc.components


           Dim geomObj

           Dim Arr

           Dim ArrLen As Integer

           Dim fabGfxObj


          For Each PO As MGCPCB.PlacementOutline In component.placementoutlines


               If PO.IsValid Then

                    If PO.Height = 0 Then

                         geomObj = PO.Geometry

                         Arr = geomObj.pointsArray

                         ArrLen = UBound(Arr, 2) + 1


                         fabGfxObj = PCBDoc.PutFabricationLayerGfx(MGCPCB.EPcbFabricationType.epcbFabAssembly, _

                                                                                               MGCPCB.EPcbSide.epcbSideTop, 4.0, ArrLen, Arr, _

                                                                                                False, Nothing, MGCPCB.EPcbUnit.epcbUnitCurrent)


                    End If

                End If



     Catch ex As Exception


     End Try




Can everyone help me? Thanks a lot!!