Flowy

Automation CopperBalancingDatas getting Outline of areas

Discussion created by Flowy on Jan 20, 2011
Latest reply on Jan 24, 2011 by Andreas.Schaefer

Hello,

 

i got following problem.

 

I manuelley generate Cooper Balancing datas with the "Copper Balancing Processor" (Setting: Shape - Circle)

With automation i would like to get the PointsArray of each area "convex hull", but I "only" get all Circle points coordinates. Is there a way solve this problem with automation?

 

docObj.CopperBalancingDatas.Item(1).Geometry.Outline(epcbUnitCurrent)
returns an Array of all "Shape - Circles" but not the Outline

 

CODE:

 

Set PCBAPP = GetObject(, "MGCPCB.Application")
Call Scripting.AddTypeLibrary("MGCPCB.Application")

Set docObj = GetLicensedDoc(PCBAPP)

PCBAPP.Gui.DisplayMessage("Debug")

Dim A
Dim cnt
Dim lastx,lasty

Dim userObj2, length, newObj
Set userObj = docObj.FindUserLayer("test")
Set userObj2 = docObj.FindUserLayer("test2")


PCBAPP.Gui.DisplayMessage("Anzahl Items: " & docObj.CopperBalancingDatas.Count)
'PCBAPP.Gui.DisplayMessage("Anzahl Items: " & docObj.CopperBalancingDatas.Item(1).Geometry)
A = docObj.CopperBalancingDatas.Item(1).Geometry.Outline(epcbUnitCurrent)
PCBAPP.Gui.DisplayMessage("IsPath: " & docObj.CopperBalancingDatas.Item(1).Geometry.IsPath)


For cnt = 1 to Ubound(A, 2)
  PCBAPP.Gui.DisplayMessage("X:Y: " & A(0,cnt-1) & " " & A(1,cnt-1))
  Call docObj.PutConstructionLine(userObj, A(0,cnt-1), A(1,cnt-1), A(0,cnt), A(1,cnt), False, epcbUnitCurrent)
Next

 

 

 

THX

Outcomes