When I try to run a ulp, it fails for almost every ulp with an error saying "<filename>(line number): error in constant".
I did some investigating, and it seems to have something to do with floating point numbers. This is just speculation but perhaps this is related to the issue where gerbers files are corrupted when Windows is configured to use a decimal comma?
When I open the .ulp file in a text editor, it seems the error occurs on the first line a floating point literal value is used.
For example, this line is OK (import-bmp.ulp: 360)
"real xScale = 1;"
But this line causes an error (import-bmp.ulp: 369)
real Offset = 0.5; // offset Wire width
This line also causes an error, seemingly because of the floating point literal (e-burkenverwaltung.ulp)
#require 6.0500
Have you tried initializing the variable with a float?
real xScale = 1.0;
Not sure it will work, but it may impact the way the compiler/interpreter handles the variable.
The problem actually occurs when a float literal is used, like 1.0. If an integer literal is used, there is no problem, even if it is assigned to a float variable. Unfortunately, float literals are used in almost every ulp, so most ulps do not work.
Any input from an Autodesk employee would be greatly appreciated. I am unable to run most ulps on both of my computers because if this bug, which makes it impossible to do certain tasks.
I had the same issue. Sometimes ULPs work and sometimes I only get "Error in constant".
Restarting Fusion helped, then ULPs work for some minutes before you get the same error again.
Hello everyone,
This is very unusual, where are you located? Do you also experience the commas in the gerber file issue?
We haven't been able to reproduce something like this. I tried a few ULPs on my Windows machine and didn't have any issues. Are you all on Windows? Anyone on Mac?
Let me know if there's anything else I can do for you.
Best Regards,
Hi Jorge,
Thanks for replying. I am located in The Netherlands and I am using Dutch regional settings (which includes a decimal comman).
However, I've set the language of my OS (Windows 10) to English because it makes it easier to google if an issue arrives. I was also experiencing the gerber decimal comma issue and I have a suspicion that there could be a relation there.
I'm happy to run or check something on my machine to provide more information.
Hi @jimUR4RG ,
Did you setup the environment variable that fixes the comma issue? If you haven't done that here's the environment variable and it's value that you need to define.
FORCE_DECIMAL_GERBER_OUTPUT
value set to true
After you create the environment variable restart Fusion 360 for it to take effect.
If they are related this should solve both issues.
Let me know if there's anything else I can do for you.
Best Regards,
Hi Jorge,
I have set the environment variable and it fixed the gerber issue but not the ULP problem. However I don't fully agree with your statement "if these issues are related, then the environment variable must fix both issues". The environment variable is clearly specific for gerber files, and has nothing to do with ULPs. There could still be an underlying issue in the way Fusion handles decimal separators that is the root of both issues.
Hi Jorge,
i also have problems with the ulp import: Windows, Germany.
At the beginning I imported a lot of bmp's successfully without problems. Then I set the environment variable because I had the comma issue in my gerber files. The variable solved the comma issue, but now I get the "error in constant" when I try to run import-bmp.ulp
After restarting Fusion, the upload works for one bmp file, then the same error occurs.
I would be very grateful for a stable and simple solution to place graphics on my PCBs.
This is the error i am getting:
error: C:/Users/conta/AppData/Local/Autodesk/webdeploy/production/9b292d8eef538636fb448307b89a33246e260a1a/Applications/Electron/LibEagle/examples/ulps/examples/import-bmp.ulp(369):
error in constant
Hey,
I'm having the same issue with import-bmp.ulp. I'm located in Germany.
I am getting the same "Error in constant " message in all ULPs I am trying on Fusion360, e. g. "import-gerber". However, I have both Fusion360 and Eagle installed in the same machine as a fallback, and "import-gerber" runs smoothly on Eagle. I am located in Brazil, and Windows is configured for the Brazilian regional settings, including comma as decimal separator.
Hi. My location is Uzbekistan. My operation system is Windows 10. I have also such kind of problem. But not all documents. ULP scripts works on some documents. It may be related to the document ?
I'm in Turkey and I get similar error for another ULP.
And it occurs occasionally, not always. Sometimes it works sometime not.
Hi @Anonymous and everyone else,
I'm trying to get more eyes on this issue to see if it can be sorted. @HelenChen-ElectronicsQA this one needs a ticket.
Best Regards,
OK, @jorge_garcia , I just logged a ticket about this. Thanks.
Regards,
Helen
Can't find what you're looking for? Ask the community or share your knowledge.