Home > Community > Forums > PCB SKILL > E- *Error* axlDBCreateText: argument #1 should be a string

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: *

 E- *Error* axlDBCreateText: argument #1 should be a string 

Last post Thu, Jan 17 2013 4:14 AM by Yann00. 3 replies.
Started by Kot13 03 Jan 2013 10:06 AM. Topic has 3 replies and 842 views
Page 1 of 1 (4 items)
Sort Posts:
  • Thu, Jan 3 2013 10:06 AM

    • Kot13
    • Not Ranked
    • Joined on Wed, Apr 25 2012
    • Posts 8
    • Points 215
    E- *Error* axlDBCreateText: argument #1 should be a string Reply

     

    Hi All,

     I'm fairly new to SKILL. I've spent a day trying to figure out an issue with my code but i've had no luck.

    What I'm trying to do is write code to automatically set up a board file. The code creates a FORM that the user fills in. If i run the code from the command line i get the following error :  "E- *Error* axlDBCreateText: argument #1 should be a string (type template = "tlggg") - nil" but if I execute the code one line at a time i do not encounter thiws error.

    The variable (pn) is filled in by the user in a FORM. Here is the code from the FORM:

    ;board pn

    fprintf(form "TEXT \"BOARD P/N: \"\n")

    fprintf(form "TLOC 6 10\n")

    fprintf(form "ENDTEXT\n")

    fprintf(form "FIELD pn\n")

    fprintf(form "FLOC 25 10\n")

    fprintf(form "STRFILLIN 25 25\n")

    fprintf(form "ENDFIELD\n")

     

    In a different function I place a layer block symbol and then use user entered information to populate all the information into the symbol. Everything works until I hit this section of code:

    TB = make_axlTextOrientation(?textBlock "5", ?rotation 0, ?mirrored nil, ?justify "center")

    axlDBCreateText(pn, LineX:LineY, TB, "board geometry/logo", nil)

    At this point I get the error mentioned above. I have gone as far as to test to make sure that pn is a string (stringp(pn)). I've even parsed pn and recreated the string. In either case I get the same error. If I comment this line out the script finishes without any errors. Also as i mentioned before if I execute the code one line at a time in the skill window I do not encounter the error.

    FYI pn is set to "B7E45-80501"

    Any help would be appreciated.

    Thanks in advance,

    Konstantin

    • Post Points: 35
  • Thu, Jan 3 2013 5:16 PM

    • D912349
    • Top 150 Contributor
    • Joined on Sat, Nov 24 2012
    • Posts 46
    • Points 780
    Re: E- *Error* axlDBCreateText: argument #1 should be a string Reply

    Hi Kot13,

    Regarding your problem. If I run your code exactly as written, the problem will be on pn. Actually pn serves as control for your text box and it is not a local variable.. So if you want to get the content of the text that is filled in to the text box, you should first use axlFormGetField to get the content. you can try this..

    lets say, textContent is avariable

     textContent = axlFormGetField(form "pn")

    TB = make_axlTextOrientation(?textBlock "5", ?rotation 0, ?mirrored nil, ?justify "center")

    axlDBCreateText( textContent, LineX:LineY, TB, "board geometry/logo", nil)

    Try this code then feedback to me if i solved your problem..

    • Post Points: 20
  • Mon, Jan 7 2013 11:14 AM

    • Kot13
    • Not Ranked
    • Joined on Wed, Apr 25 2012
    • Posts 8
    • Points 215
    Re: E- *Error* axlDBCreateText: argument #1 should be a string Reply

     

    Thanks for the advice. I was able to get the desired results.

     

    Thanks,

    -K

    • Post Points: 5
  • Thu, Jan 17 2013 4:14 AM

    • Yann00
    • Top 200 Contributor
    • Joined on Tue, Dec 4 2012
    • Posts 42
    • Points 585
    Re: E- *Error* axlDBCreateText: argument #1 should be a string Reply

    Hi Kot13,

     

    Could I see your work because I have exactly the same thing to do. The user come and fills in User.txt

    Then my SKILL code automatize the fills in of my board outline. I get you the two attachments.

    Tanks a lot.

    Yann

    • Post Points: 5
Page 1 of 1 (4 items)
Sort Posts:
Started by Kot13 at 03 Jan 2013 10:06 AM. Topic has 3 replies.