Home > Community > Forums > PCB SKILL > Checklist Autofill

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Checklist Autofill 

Last post Mon, Feb 3 2014 5:06 PM by eDave. 4 replies.
Started by eddieb1 30 Jan 2014 12:50 PM. Topic has 4 replies and 2806 views
Page 1 of 1 (5 items)
Sort Posts:
  • Thu, Jan 30 2014 12:50 PM

    • eddieb1
    • Not Ranked
    • Joined on Thu, Jul 17 2008
    • Posts 12
    • Points 165
    Checklist Autofill Reply
    Hello experts,

    Need your help on how to do the following.

    1. Run command to look for the Jconnectors (J01, J02...J80)  on a brd file.

    2. Place a checkmark on the checklist box identfying the Jconnectors found.

    3. Deactivate (grayed out) checkbox of Jconnectors not found.

    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.

    5. Click OK button to finish/close the UI checklist form.

     Note:

    If you can see the jpg below, that's the checklist form that I'm planning on using.


    How do I go about this?

    Thanks in advance,

    Eddie
    Filed under: ,
    • Post Points: 20
  • Mon, Feb 3 2014 1:36 PM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 688
    • Points 14,675
    Re: Checklist Autofill Reply

    Hi Eddie,

    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)

    else

    ; 3. Deactivate (grayed out) checkbox of Jconnectors not found.

    axlFormSetField(form, fieldName, nil)

    axlFormSetFieldEditable(form, fieldName, nil)

    )

    )

    axlFormDisplay(form)

    ))

     

    ; Callback:

    defun( Eddie_stripJviaKO_callBack (form)

     let((symbol)

    case(form ->curField

    ; 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.

    ("apply"

    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"))))

    )

    )

    ("ok"

    ; 5. Click OK button to finish/close the UI checklist form.

    axlCancelEnterFun(), axlFormClose(form)

    )

    )

    )) 

    Dave Elder, Tait Communications
    • Post Points: 35
  • Mon, Feb 3 2014 2:35 PM

    • eddieb1
    • Not Ranked
    • Joined on Thu, Jul 17 2008
    • Posts 12
    • Points 165
    Re: Checklist Autofill Reply

     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 fileJconn. Hopefully it will not get filtered out.

     

    Edit:

     

    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.

     

    https://www.dropbox.com/s/69wvsg4iudxdvcb/jconn1.JPG

     

     Regards,

    Eddie

     

    • Post Points: 5
  • Mon, Feb 3 2014 5:03 PM

    • eddieb1
    • Not Ranked
    • Joined on Thu, Jul 17 2008
    • Posts 12
    • Points 165
    Re: Checklist Autofill Reply

     Hi Dave,

    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?

     

    Thanks,

    Eddie

    • Post Points: 20
  • Mon, Feb 3 2014 5:06 PM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 688
    • Points 14,675
    Re: Checklist Autofill Reply

    Hi Eddie,

    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. dave.elder@taitradio.com 

    Dave Elder, Tait Communications
    • Post Points: 5
Page 1 of 1 (5 items)
Sort Posts:
Started by eddieb1 at 30 Jan 2014 12:50 PM. Topic has 4 replies.