Closed Kartohen closed 1 year ago
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.
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 ...
I've found the place where this error appears in the code:
Changing var Extents helps to avoid error.
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.
On the next step I receive this error:
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.
I have this result for Outline:
I've added ;
to all lines
But error is the same:
I've added ;
to the next block:
Now the next error is:
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.
After commenting export did complete. Would it be useful to attach .json file here?
I have this list of layers:
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" ) )
I set extents = margin
to prevent error about nil, if it matters.
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?
Outline:
Skill > segments = car( axlDBGetShapes( "Board Geometry/Outline" ) ) dbid:376073928 Skill >
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.
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
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.
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.
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.
Now it works! You made great script, Thank You! And Thank You for help!
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 ;)
Please check my latest version of the script, which should handle all layers correctly.
The latest version works properly with ver. 16.6! Thank you!
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.
Can you share the .json file?
As I understand, in this line, for example, should be "layer": "F"
?
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!
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
I added line print( symbol->layer )
to file exportJson, is it my mistake?
Should I add it to file .json?
No, to the exportJson.il
. But please check my latest commit, I hope, I fixed it.
Still the same result: emprty Front side.
And do you have an opportunity to open my .json file in iBOM? Maybe mistake is only on my side?
In .json we need here and for the same elements "F"
:
This way iBom would work correct.
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!
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 >
Ok, give me some time to make some changes to the code.
Please update to the latest version and give it another try ... hopefully it works now!
Now everything is alright! Thank You!
Is this plugin supported for PCB Designer 16.6? It shows me an error for the board from example.