1 Reply Latest reply on Oct 4, 2012 3:25 AM by matthias.cosaert

    Script from Tutorial stops on line 63....can anyone tell me why?

    diane.j.dickoff

      This script is from Mentor's automation tutorial....

      I can not get this line to work...any help/suggestions?

       

      Line 63

       

      Set usrLyrGfxObj = pcbDocObj.PutUserLayerGfx(userLayerObj,

       

       

       

      I have attached the entire script below...

       

      Thanks, Diane.

        • 1. Re: Script from Tutorial stops on line 63....can anyone tell me why?
          matthias.cosaert

          Hi Diane,

           

          Finduserlayer(..)  will return nothing if the userlayer doesn't exist so best to add a check after it:

           

          if userLayerObj is nothing then

               Set userLayerObj = pcbDocObj.SetupParameter.PutUserLayer("Test") 'Let's make a new user layer

               'pick color so it isn't a dark one

               set pcbDocObj.ActiveView.DisplayControl.Global.UserLayerColor("test") = pcbAppObj.Utility.NewColorPattern(255,255,255) 'rgb

          end if

           

          ' Ensure the user layer is turned on

          pcbDocObj.ActiveView.DisplayControl.UserLayer("Test") = True

           

          Also make sure that the array doesn't self intersect since it's a polygon (can try to draw polyline by changing numPntsInt to (numPntsInt - 1) and filledBool = false so begin and endpoint is different and it draws a polyline)