Start a new topic

Can you create a sample LUA script I can run in FAB 3000 that will find all Donut Flashes and add a clear inner hole?

Can you create a sample LUA script I can run in FAB 3000 that will find all Donut Flashes and add a clear inner hole? The purpose is to prevent ends of traces from appearing within the ID of my donut pads.

Hi

tried this script, but only got following error:

[CODE]'_Run App
LUA File: F:\Downloads\add_clear2donut.lua
F:\Downloads\add_clear2donut.lua:24: attempt to call field 'dbGetDcodeNum' (a nil value)[/CODE]
There was a gerberfile with donuts loaded.

Here's a sample LUA script to perform your requirements.  Just copy/paste to a text file and save with an extension .LUA    You can then go to FAB 3000 load in your Gerber files and Run the LUA script file.

 

-- LUA Application File
-- Purpose is to find all Donut Flashes and add a clear inner hole
-- Which prevents traces from appearing within the ID

-- Flashed Pads Filter
arObjectTypes = fab3000.dbIntArray()
arObjectTypes:append( fab3000.dbcFlashType )
 
-- Select All Flashed Pads
sset =  fab3000.dbSelectionSet()
sset:setTypeFilter( arObjectTypes )
nCount = sset:selectAll() - 1

-- Loop Through Selected Objects
for nVal = 0, nCount, 1 do
    
    --Get Object Center
    myObject         = sset:index( nVal )
    myBox            = fab3000.dbBox()
    fab3000.dbGetBBox(myObject, myBox)
    myCenterPt        = myBox:getCenter();
    
    --Get Dcode and Layer
    nDcode             = fab3000.dbGetDcodeNum( myObject );
    nLayer             = fab3000.dbGetLayerNum( myObject );
    
    --Get Aperture
    myAptCheck = fab3000.dbAperture()
    fab3000.dbGetAperture( nDcode, myAptCheck )

    --Add Composite Circle
    if myAptCheck:getType()==fab3000.dbApertureTypeDonut then
        --Note: I assigned a default Composite value of 5
        fab3000.uiAddCircle( nLayer, 5, myCenterPt, myAptCheck:getID() );
    end

end

 

Login or Signup to post a comment