1 Reply Latest reply on Dec 9, 2011 1:20 AM by a.sassano

    PADS VB Script to add Copper Balancing shapes

    b.hassink

      Hi,

       

      Could someone please assist me in creating copper ballancing shapes to the PCB in an automated fashion.

       

      See screenshot below.

       

      Automation to add copper ballancing shapes.png

       

      We did some testing with a macro...

       

       

      Application.ShowBar("Drafting Toolbar")

      Application.ExecuteCommand("Add 2D Line Polyline")

      Application.ExecuteCommand("Drafting Rectangle Mode")

      Application.ExecuteCommand("Add Corner To Drafting", 0mil, 0mil)

      Application.ExecuteCommand("Add Corner To Drafting", 1000mil, 1000mil)

      Application.ExecuteCommand("Cancel")

      Application.ExecuteCommand("Select", 0mil, 0mil)

      Application.ExecuteCommand("Properties")

      DraftingPropertiesDlg.DraftingType = "Copper"

      DraftingPropertiesDlg.Ok.Click()

       

      When trying to add a variable for the X, Y coordinates, then it doesn’t work anymore:

       

      x = 0

      y = 0

      xc1 = x & "mil"

      yc1 = y & "mil"

      xc2 = x+1000 & "mil"

      yc2 = y+1000 & "mil"

      Application.ShowBar("Drafting Toolbar")

      Application.ExecuteCommand("Add 2D Line Polyline")

      Application.ExecuteCommand("Drafting Rectangle Mode")

      Application.ExecuteCommand("Add Corner To Drafting", xc1, yc1)

      Application.ExecuteCommand("Add Corner To Drafting", xc2, yc2)

      Application.ExecuteCommand("Cancel")

      Application.ExecuteCommand("Select", 0mil, 0mil)

      Application.ExecuteCommand("Properties")

      DraftingPropertiesDlg.DraftingType = "Copper"

      DraftingPropertiesDlg.Ok.Click()

       

       

      Looking at the syntax color of the coordinates in example #1 I notice that it should be different than a string. Also there are no quotes. I have no idea what it should be so any help from your side would be appreciated.

       

      Best regards,

      Bas Hassink