I'm facing a problem and did not find it after hours of searching.
I will get a selected plane obstruct and copy it to x other layers
Here the core code:
Set pcbapp = GetObject(, "MGCPCB.ExpeditionPCBApplication")
Set pcbDoc = pcbapp.ActiveDocument
If ValidateServer(pcbDoc) = 0 Then
MsgBox "Document Validation failed."
set obst = pcbDoc.Obstructs(epcbObstructAll, epcbSelectSelected)
AoP = obst.item(1).Geometry.PointsArray
obtype = obst.item(1).ObstructType
npoints = UBound(AoP,2) +1
putlayer = 2 ' only one for testing
set obst = pcbDoc.PutObstruct(putlayer,0, npoints, AoP,obtype )
Why it works in Excel and not in a script? What is wrong?