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:
fprintf(form "TEXT \"BOARD P/N: \"\n")
fprintf(form "TLOC 6 10\n")
fprintf(form "FIELD pn\n")
fprintf(form "FLOC 25 10\n")
fprintf(form "STRFILLIN 25 25\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,
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")
axlDBCreateText( textContent, LineX:LineY, TB, "board geometry/logo", nil)
Try this code then feedback to me if i solved your problem..
In reply to D912349:
Thanks for the advice. I was able to get the desired results.
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.