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.
0 Votes
2 Comments
Sorted by
N
Numerical Support Teamposted
about 11 years ago
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
0 Votes
a
as-fablxforumposted
about 11 years ago
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.
0 Votes
2 Comments
Numerical Support Team posted about 11 years ago
-- 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 end0 Votes
as-fablxforum posted about 11 years ago
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.
0 Votes
Login or Sign up to post a comment