Comments (42)
Unfortunetly this is a question I can't answer ... all programming and tests were done with 17.4. Based on the error I can guess, that the program is trying to access a value from an element that does not exist ... I try to add some debug messages to the code, so we can figure where this is happening ... thanks to cadence the line where the error occurs is not printed to the console ... but please give me some time for this.
from exportjson.
another hint: all actions need to be completed / closed by clicking 'done', otherwise the skill scripts often do not run properly ... but I don't think, that this is the case here ...
from exportjson.
I've found the place where this error appears in the code:
Changing var Extents helps to avoid error.
from exportjson.
Thanks for your help! Maybe I have to add some lines of code, so that the script does not run into this error ... maybe the pcb editor 16.6 does not support the dsn->designOutline
or the axlDBGetExtents
call ... could you check what is the output of the outline
, segments
and extents
by typing the following to the skill command line?
open the skill comand line ( set teslkill
)
dsn = axlDBGetDesign()
outline = dsn->designOutline
outline should print somethings like this dbid:000001B548763A30
segments = outline->segments
should print a list of dbids
extents = axlDBGetExtents( segments nil )
prints two coordinates, if everything works as intended.
from exportjson.
On the next step I receive this error:
from exportjson.
seems like version 16.6 and 17.4 differs in their default layers ... the BOARD GEOMETRY/CUTOUT
is a fixed layer in 17.4 ...
If you don't have any cutouts you can comment the whole "add cutout to edges list" commands (add a ;
to each line)
cutout = car( axlDBGetShapes( "BOARD GEOMETRY/CUTOUT" ) )
segments = cutout->segments
foreach( segment segments
; parse segment
if( pcbLinewidth then
element = parseSegment( segment pcbLinewidth )
else
element = parseSegment( segment segment->width )
)
if( boundp( 'edges ) then
tconc( edges element )
else
edges = tconc( nil element )
)
)
or change the layer name to the correct layer name.
from exportjson.
I have this result for Outline:
from exportjson.
I've added ;
to all lines
But error is the same:
from exportjson.
I've added ;
to the next block:
Now the next error is:
from exportjson.
okay... yeah, sorry, I forgot, that we don't have any information for the board outline now (dsn->boardOutline is nil) ... and edges is an unbound ... maybe we can check, if this is the only error we are running in.
Please do the following:
Comment out the addBoardGeometry and execute exportJson
The function should complete, if there are no further "mistakes". If this works, we try to find a solution for our initial problem.
from exportjson.
After commenting export did complete. Would it be useful to attach .json file here?
from exportjson.
I have this list of layers:
from exportjson.
After commenting export did complete. Would it be useful to attach .json file here?
No, I don't need the .json file, but now we know, that we just need to modify the addBoardGeometry
function.
Does this prints any dbids?
segments = car( axlDBGetShapes( "Board Geometry/Design_Outline" ) )
from exportjson.
from exportjson.
I set extents = margin
to prevent error about nil, if it matters.
from exportjson.
I set
extents = margin
to prevent error about nil, if it matters.
I don't think this is a problem. Can you find out, what's the name of the pcb contour layer and the cutouts? And then execute the previous command with the layer name?
from exportjson.
Outline:
Skill > segments = car( axlDBGetShapes( "Board Geometry/Outline" ) ) dbid:376073928 Skill >
from exportjson.
Then you don't need the lines 686 - 688:
Can be removed:
dsn = axlDBGetDesign()
outline = dsn->designOutline
segments = outline->segments
and replaced by:
segments = car( axlDBGetShapes( "Board Geometry/Outline" ) )
Maybe you can try, if extents = axlDBGetExtents( segments nil )
is working now, otherwise leave it as you modified it.
Uncomment the previously commented line addBoardGeometry and give the exportJson a new try.
from exportjson.
Now I get this kind of error:
E- *Error* foreach: second argument must be a list - dbid:177495752
Maybe the issue is in Cutout layer? I can't find it, the only similar layer name is Cut_marks. But for this layer I have:
Skill > segments = car( axlDBGetShapes( "Board Geometry/Cut_Marks" ) )
nil
from exportjson.
To get this running without the cutout layer (comment line 726 - 739).
Does this error returns from the call axlDBGetExtents ( ... )
? Then please modify it the way you have done it before.
from exportjson.
All variants give the same result:
E- *Error* foreach: second argument must be a list - dbid:177495752
Only if I comment lines 707-750, export can complete.
from exportjson.
My mistake ...
it should be:
outline = car( axlDBGetShapes( "Board Geometry/Outline" ) )
segments = outline->segments
instead of only
segments = car( axlDBGetShapes( "Board Geometry/Outline" ) )
Please try this.
from exportjson.
Now it works! You made great script, Thank You!
And Thank You for help!
from exportjson.
Ok, great! I'll check, if I can solve the issue with a few lines of code, so that the script is also working for older versions of allegro.
Thank you for reporting this issue ;)
from exportjson.
Please check my latest version of the script, which should handle all layers correctly.
from exportjson.
The latest version works properly with ver. 16.6! Thank you!
from exportjson.
I found out, that in HTML all elements are located on Back side and Front side is empty. File from the example works correct, and file .json that was made in ver. 16.6 has this error.
from exportjson.
Can you share the .json file?
from exportjson.
from exportjson.
As I understand, in this line, for example, should be "layer": "F"
?
from exportjson.
Yes, if I run the script on this project the layer is set to "F"
.
Can you add the following to line 1381:
print( symbol->layer )
And tell me what is the output? Thanks!
from exportjson.
Result is the same, Front is empty
The command should have printed something to your command line.
But I think I have to change the code there ... please have some patience
from exportjson.
I added line print( symbol->layer )
to file exportJson, is it my mistake?
Should I add it to file .json?
from exportjson.
No, to the exportJson.il
. But please check my latest commit, I hope, I fixed it.
from exportjson.
Still the same result: emprty Front side.
from exportjson.
And do you have an opportunity to open my .json file in iBOM? Maybe mistake is only on my side?
from exportjson.
In .json we need here and for the same elements "F"
:
This way iBom would work correct.
from exportjson.
Yes, this is what I just saw ... But please do this as I described above and make your command line visible, because the information I need is only printed to the command line. And tell me the results.
Yes, if I run the script on this project the layer is set to
"F"
.Can you add the following to line 1381:
print( symbol->layer )
And tell me what is the output? Thanks!
from exportjson.
I've added here:
; get symbol layer
print( symbol->layer )
if( symbol->layer == "TOP" then
layer = "\"F\""
else
layer = "\"B\""
)
This is result in command line:
Command > exportJson
CDS version: 16.600000
nilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnilnil"Export complete!"
W- *WARNING* No variant.lst found, exporting entire design ...
Command >
from exportjson.
Ok, give me some time to make some changes to the code.
from exportjson.
Please update to the latest version and give it another try ... hopefully it works now!
from exportjson.
Now everything is alright! Thank You!
from exportjson.
Related Issues (11)
- exportJson error:can't handle (nil - 0.0) HOT 11
- Does this change the actual alegro file as well? HOT 18
- Can I do this using command prompt HOT 21
- Opportunity to convert several Outline shapes to json for Allegro 16.6 HOT 6
- *Error* difference: can't handle (nil-0.0) HOT 5
- Hello! Can other parameters be added to the BOM? For example, self-defined parameters such as' VOLTAGE 'or' Tolerance ' HOT 4
- Can't parse json with cutouts HOT 10
- Thieving export and missing dummy lines HOT 9
- Dummy net lines are absent HOT 3
- Customizable output layer mapping HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exportjson.