I can't see your jpeg but I am assuming that you already have a form with the appropriately named fields.
Here's some (unverified) code to get you going:
defun( Eddie_stripJviaKO (formFile)
let((form, symbols, fieldName)
form = axlFormCreate(gensym(), formFile, nil, 'Eddie_stripJviaKO_callBack, nil)
; 1. Run command to look for the Jconnectors (J01, J02...J80) on a brd file.
symbols = setof(s, axlSelectByName("REFDES", "J??", t), rexMatchp("J[0-8][0-9]", s ->refdes))
for(i, 1, 80
fieldName = strcat("J", substring(sprintf(nil, "0%d", i), -2))
if(exists(s, symbols, s ->refdes == fieldName) then
; 2. Place a checkmark on the checklist box identfying the Jconnectors found.
axlFormSetField(form, fieldName, t)
axlFormSetFieldEditable(form, fieldName, t)
; 3. Deactivate (grayed out) checkbox of Jconnectors not found.
axlFormSetField(form, fieldName, nil)
axlFormSetFieldEditable(form, fieldName, nil)
defun( Eddie_stripJviaKO_callBack (form)
; 4. Run a command to delete the Via KO Shape on the Jconnectors found (using a known x-y location). -- Use Apply to run the delete command.
foreach(field, setof(f, form ->fields, rexMatchp("J[0-8][0-9]", f) && axlFormGetField(form, f))
symbol = car(axlSelectByName("REFDES", field, t))
axlDeleteObject(setof(shp, symbol ->children, shp ->layer == strcat("VIA KEEPOUT/", if(symbol ->isMirrored, "BOTTOM", "TOP"))))
; 5. Click OK button to finish/close the UI checklist form.
Dave Elder, Tait Communications
In reply to eDave:
Thanks Dave for the reply.
I'll take your code for a spin and let you know the results asap.
In the meantime I'm attaching the link to the jpg file. Hopefully it will not get filtered out.
1. Run command (by clicking a button - see JPG) to look for the Jconnectors (J01, J02...J80) on a brd file.
Updated the jpg file as the one I posted was an older version.
I can't seem to get this code to run. It might be because my unfamiliarity with the defun command (still new at this). Been exposed to the procedure function. Tip or two to get the form to launch?
In reply to eddieb1:
The code won't run without some work.
defun is similar to procedure. Just don't change my white spaces.
I assume that you have a form file?
This discussion might be better off line. email@example.com